How to use schemaglue - 2 common examples

To help you get started, we’ve selected a few schemaglue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pearce89 / graphql-auth / server / src / server.js View on Github external
import {
  decodeToken,
} from '~/src/app/auth/jwt'

const logger = pino({
  enabled: !(process.env.LOG_ENABLED === 'false')
})
const environment = process.env.NODE_ENV || 'development'
const graphqlSchemaPath = (['development', 'test'].includes(environment)) ?
  './src/app/graphql' : './dist/app/graphql'

const {
  schema,
  resolver
} = glue(graphqlSchemaPath)

let graphQLSchema = makeExecutableSchema({
  typeDefs: schema,
  resolvers: resolver,
})

graphQLSchema = applyMiddleware(graphQLSchema, permissions)

const server = new ApolloServer({
  schema: graphQLSchema,
  introspection: true,
  playground: true,
  context: async ({ req }) => {
    logger.info(req.headers, '[HEADERS]')
    logger.info(req.body.query, '[QUERY]')
    logger.info(req.body.variables, '[VARIABLES]')
github Vheissu / aurelia-graphql-apollo / server / apollo / index.js View on Github external
import glue from 'schemaglue';

export const { schema, resolver } = glue('server/apollo');

schemaglue

Glues multiple parts of a GraphQL schema together(incl. resolvers). This library is designed specifically for building GraphQL schema using Apollo's graphql-tools.js

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular schemaglue functions