Advanced API usage
#
Turning off introspectionIntrospection is super useful for tools like GraphiQL, but can potentially expose functionality that you do not want to expose on clients. Finch GraphQL has the ability to turn off introspection.
Now any type of introspection query will fail. This functionality is achieved using GraphQL Validation.
#
Custom message keysIn Finch GraphQL we use a generic message key of finch-message
, and if you wanted to have a custom message key that would be possible by passing in the custom message key to Finch GraphQL.
This allows you to make you connections with external source more secure by have a shared key to access the information in the extension. The also can help support older versions of Finch GraphQL.
#
Using middlewareTo be able to support a wide array of functionality like tracing, logging, and performances tracking Finch GraphQL has middleware functionality built into it. This is not needed for basic usage of Finch GraphQL but can give you insight in development if your queries are even being processed or how long things are taking to process.
In the example above we are logging the operation name and the time it takes to run the operation. This should look something like this in the console.
There is many possibilities with this functionality, and here is a list of modules that potentially can work with this middleware.
This middleware modules primary use cases are server side GraphQL APIs and may run into issues running in a browser environment.
#
Running validationGraphQL has built in validation and we expose that functionality to allow you to setup custom validators for graph.
Above is an internal implementation that allows use to turn off introspection. The official docs around this functionality can be found here.