Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated directive used in extend type is broken with mergeSchemas #1254

Closed
BrendanBall opened this issue Dec 4, 2019 · 3 comments
Closed

Comments

@BrendanBall
Copy link
Contributor

dependencies:
"graphql": "^14.5.8",
"graphql-tools": "^4.0.6"
I'm getting Unknown directive "deprecated" when using the deprecated directive in an extend type and mergeSchemas. Just using makeExecutableSchema works fine.

const { mergeSchemas, makeExecutableSchema } = require('graphql-tools');

const chirpSchema = `
  type Chirp {
    id: ID!
    text: String
    authorId: ID!
    "works"
    foo: String! @deprecated(reason: "test")
  }

  type Query {
    chirpById(id: ID!): Chirp
    chirpsByAuthorId(authorId: ID!): [Chirp]
  }

  extend type Chirp {
    "breaks"
    bar: String @deprecated(reason: "test")
}
`

const authorSchema = `
  type User {
    id: ID!
    email: String
  }

  type Query {
    userById(id: ID!): User
  }
`

makeExecutableSchema({ typeDefs: chirpSchema }); // works
mergeSchemas({ schemas: [chirpSchema] }); // Error: Unknown directive "deprecated".
mergeSchemas({ schemas: [chirpSchema, authorSchema] }); // Error: Unknown directive "deprecated".
@yaacovCR
Copy link
Collaborator

Works with graphql-tools-fork v8.2.0.

@TimSusa
Copy link

TimSusa commented Mar 21, 2020

Why just not taking over graphql-tools-fork fixes to graphql-tools? Really hard for me to understand, just to say its deprecated. Seems to me, like a sad story.

@yaacovCR
Copy link
Collaborator

Rolled into #1306 .

@yaacovCR yaacovCR mentioned this issue Mar 29, 2020
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants