Skip to content

Ability to exclude Query, Mutation and Subscription types from imported schema #205

@atten

Description

@atten

This feature would be useful when we have types and inputs generated by Prisma, and want to add custom implemented Query and Mutation for real-world app.

For example:

const { importSchema } = require("graphql-import");
const { GraphQLServer } = require('graphql-yoga');
const { mergeTypes } = require("merge-graphql-schemas");

const typeDefs = mergeTypes([
  importSchema(`# import * from './src/graphql/generated/prisma.graphql'`),
  readFileSync('./src/common/schema.graphqls', {encoding: 'utf-8'}),
  readFileSync('./src/auth/schema.graphqls', {encoding: 'utf-8'}),
  ...
], { all: true });

const server = new GraphQLServer({
  typeDefs,
  ...
});

But now I can't do that because importSchema grabs generated Query and Mutation types directly into application API.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions