useSchema
Package name | Weekly Downloads | Version | License | Updated |
---|---|---|---|---|
@envelop/core (opens in a new tab) | Feb 20th, 2023 |
useSchema
This plugin is the simplest plugin for specifying your GraphQL schema. You can specify a schema created from any tool that emits GraphQLSchema
object.
import { envelop, useSchema, useEngine } from '@envelop/core'
import { parse, validate, specifiedRules, execute, subscribe } from 'graphql'
const mySchema = buildSchema(/* ... */)
const getEnveloped = envelop({
plugins: [
useEngine({ parse, validate, specifiedRules, execute, subscribe }),
useSchema(mySchema)
// ... other plugins ...
]
})