How to use the apollo-server.gql function in apollo-server

To help you get started, we’ve selected a few apollo-server 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 reactioncommerce / reaction / tests / util / TestApp.js View on Github external
this.query = (query) => async (variables) => {
      const result = await this.graphClient.query({ query: gql(query), variables });
      if (result.errors) throw result.errors;
      return result.data;
    };
  }
github reactioncommerce / reaction / tests / util / TestApp.js View on Github external
this.mutate = (mutation) => async (variables) => {
      const result = await this.graphClient.mutate({ mutation: gql(mutation), variables });
      if (result.errors) throw result.errors;
      return result.data;
    };
github Human-Connection / Human-Connection / embed / src / graphql-schema.js View on Github external
const fs = require('fs')
const path = require('path')

const { gql } = require('apollo-server')

module.exports = gql(fs
  .readFileSync(path.join(__dirname, 'schema.graphql'))
  .toString('utf-8'))
github agoldis / sorry-cypress / packages / api / src / schema / schema.ts View on Github external
import { gql } from 'apollo-server';
import { importSchema } from 'graphql-import';
import path from 'path';

export const typeDefs = gql(
  importSchema(path.resolve(__dirname, './schema.graphql'))
);