-
Notifications
You must be signed in to change notification settings - Fork 396
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
A custom directive didn't apear in scheme #1278
Comments
Looks like this is a duplicate of #1239 which was closed due to missing information. Minimal reproduction of the problem with instructionsgit clone https://github.com/mrkswrnr/nestjs-graphql-missing-directive.git
cd nestjs-graphql-missing-directive
npm i
npm run start open http://localhost:3000/graphql Here is the schema you should see directive @specifiedBy(url: String!) on SCALAR
type Query {
tests: [Test!]!
}
type Test {
id: ID!
name: String!
}
The upper directive is not defined and missing above the "name" field. Also there is no deprecation directive above the tests query. Running Environment
|
This is the expected behavior. This issue has been discussed several times in the past. Your directives will be applied to types, but they won't be visible in the generated GraphQL schema file. You can find more details about - why - this is the case here graphql/graphql-js#1343 |
Hi, I not understand why this issue is closed?Discussion which you mentioned is still open. And in any way, deprecated directive must appears in schema, as in other case it breaks Apollo Federation behaviour. |
Because there's no sense to track this in multiple places. Once this is supported by GraphQL, we'll surely implement this in this package. |
I'm submitting a...
Hello.
I have no a lot of experience in graphQL.
I try to add a custom directive to my project. I just copy-pasted the code from the documentation.
So I created
UpperCaseDirective
and if I apply it to my model as a decorator it works but I want to apply it on my client-side and it doesn't work. Additionally, I createdDeprecatedDirective
and after applying the directive for a model's field it started to be deprecated but just in playground. My generated scheme has no mentions about deprecated fields. It is not a problem if I use a single graphql service but for graphQL federation, the fields lose deprecated.Current behavior
I added 2 directives
Expected behavior
I expected the directive should appear on the top of graphQL schema. At list deprecated should be after the field.
I confused. I spent many hours to understand what happens and have no result.
Please answer Is an opportunity to add directives to my scheme?
The text was updated successfully, but these errors were encountered: