GraphQL Mesh is a framework that helps shape and build an executable GraphQL schema from multiple data sources.
@graphcommerce/graphql-mesh/meshConfig
method which allows you to create
plugins for the mesh configurationadditionalTypeDefs
, additionalResolver
, sources.handlers.openapi.source
accept module patterns @graphcommerce/my-package/resolver.ts
*.graphqls
files are automatically loaded from the project root.schema/**/*.graphqls
are automatically loaded.schema246
/ schema247
etc. folders.To make modifications to the Mesh configuration, you can:
You can always modify the base configuration of the Mesh by modifying the
meshrc.yaml
file.
import type { meshConfig as meshConfigBase } from '@graphcommerce/graphql-mesh/meshConfig'
import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
export const config: PluginConfig = {
module: '@graphcommerce/graphql-mesh/meshConfig',
type: 'function',
}
export const meshConfig: FunctionPlugin<typeof meshConfigBase> = (
prev,
baseConfig,
graphCommerceConfig,
) => {
prev({
...baseConfig,
sources: [
...baseConfig.sources,
{
name: 'mySource',
handler: {
graphql: {
endpoint: 'https://my-source.com/graphql',
},
},
},
],
})
}