How to use the apollo-server-koa.makeExecutableSchema function in apollo-server-koa

To help you get started, we’ve selected a few apollo-server-koa 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 strapi / strapi-examples / nextjs-react-strapi-deliveroo-clone-tutorial / backend / plugins / graphql / services / Schema.js View on Github external
'query',
        )}${query}}
      type Mutation {${shadowCRUD.mutation &&
        this.formatGQL(
          shadowCRUD.mutation,
          resolver.Mutation,
          null,
          'mutation',
        )}${mutation}}
      ${Types.addCustomScalar(resolvers)}
      ${Types.addInput()}
      ${polymorphicDef}
    `;

    // Build schema.
    const schema = makeExecutableSchema({
      typeDefs,
      resolvers,
    });

    if (!strapi.config.currentEnvironment.server.production) {
      // Write schema.
      this.writeGenerateSchema(graphql.printSchema(schema));
    }

    // Remove custom scaler (like Upload);
    typeDefs = Types.removeCustomScalar(typeDefs, resolvers);

    return {
      typeDefs: gql(typeDefs),
      resolvers,
    };
github strapi / strapi-examples / nuxt-strapi-deliveroo-clone-tutorial / server / plugins / graphql / services / Schema.js View on Github external
'query',
        )}${query}}
      type Mutation {${shadowCRUD.mutation &&
        this.formatGQL(
          shadowCRUD.mutation,
          resolver.Mutation,
          null,
          'mutation',
        )}${mutation}}
      ${Types.addCustomScalar(resolvers)}
      ${Types.addInput()}
      ${polymorphicDef}
    `;

    // Build schema.
    const schema = makeExecutableSchema({
      typeDefs,
      resolvers,
    });

    if (!strapi.config.currentEnvironment.server.production) {
      // Write schema.
      this.writeGenerateSchema(graphql.printSchema(schema));
    }

    // Remove custom scaler (like Upload);
    typeDefs = Types.removeCustomScalar(typeDefs, resolvers);

    return {
      typeDefs: gql(typeDefs),
      resolvers,
    };
github strapi / strapi / packages / strapi-plugin-graphql / services / Schema.js View on Github external
type Mutation {${shadowCRUD.mutation &&
        this.formatGQL(
          shadowCRUD.mutation,
          resolver.Mutation,
          null,
          'mutation'
        )}${mutation}}
      ${Types.addCustomScalar(resolvers)}
      ${Types.addInput()}
      ${polymorphicDef}
    `;

    // // Build schema.
    if (!strapi.config.currentEnvironment.server.production) {
      // Write schema.
      const schema = makeExecutableSchema({
        typeDefs,
        resolvers,
      });

      this.writeGenerateSchema(graphql.printSchema(schema));
    }

    // Remove custom scalar (like Upload);
    typeDefs = Types.removeCustomScalar(typeDefs, resolvers);

    return {
      typeDefs: gql(typeDefs),
      resolvers,
    };
  },
github velopert / velog-server / src / graphql / schema.ts View on Github external
_version: String
  }
  type Mutation {
    _empty: String
  }
`;

const resolvers: IResolvers = {
  Query: {
    _version: () => '1.0'
  },
  Mutation: {},
  Date: DateScalar
};

const schema = makeExecutableSchema({
  typeDefs: [typeDef, user.typeDef, post.typeDef, comment.typeDef, series.typeDef, tag.typeDef],
  resolvers: merge(
    resolvers,
    user.resolvers,
    post.resolvers,
    comment.resolvers,
    series.resolvers,
    tag.resolvers
  )
});

export default schema;