Docs

GraphQL EZ

Get Started

Plugin Hub > GraphQL Modules

npm version
yarn add @graphql-ez/plugin-modules

@graphql-ez/plugin-modules#

Integration with GraphQL Modules

Usage#

This plugin add an extra registerModule helper in your ezApp, which will automatically add the specified GraphQL Module in your GraphQL EZ Application, this plugin will take care of the rest.

This plugin works the best paired with the GraphQL Code Generator plugin with the option deepPartialResolvers enabled (already enabled by default)

import { ezGraphQLModules, gql } from '@graphql-ez/plugin-modules'; const ezApp = CreateApp({ ez: { plugins: [ ezGraphQLModules({ // ApplicationConfig https://www.graphql-modules.com/docs/api#applicationconfig }), // ... ], }, // ... }); // ... ezApp.registerModule( gql` type Query { hello: String! } `, { resolvers: { Query: { hello(_root, _args, _ctx) { return 'Hello World'; }, }, }, } ); // ... ezApp.registerModule( gql` extend type Query { bye: String! } `, { resolvers: { Query: { bye(_root, _args, _ctx) { return 'Bye World'; }, }, }, } );

Plugin Details

Identifier
@graphql-ez/plugin-modules
License
MIT
Version
0.12.0
Updated
Dec 18th, 2022