Graphcool, a GraphQL backend for mobile and web developers, has introduced a new function to extend the Graphcool API: resolvers. Resolver functions enable developers to extend Graphcool's auto-generated CRUD API with custom queries.
"Resolvers are one of the most powerful features offered with Graphcool," the company commented in an announcement. "As such, they cover a tool which is applicable for a wide range of situations."
Graphcool anticipates that the "wide range of situations" will include custom authentication workflows (e.g. by integrating with Auth0, Firebase Auth, AWS Cognito, and other login and authorization providers), external API wraps (e.g. integrating with external APIs like a weather or geolocation API), and Graphcool API wraps (e.g. introduce a custom mutation). Graphcool published a video that demonstrates some of these use cases.
To utilize the resolver function, add the function from the Graphcool Console. Within the Console, select the Functions tab and click "New Function." Select the Resolver tab, and then click on "Define Function". Next, extend the Query or Mutation type. Finally, provide a name for the function and click "Create Function".
For more specifics, visit Resolvers within the docs. To check out all Graphcool functions, visit the collection on GitHub. On Github, those interested will find a number of examples for inspiration. Follow the Graphcool blog for more announcements.