I am testing some GraphQL documentation generators and trying to use .redwood/schema.graphql
as input (instead of introspection). I noticed while testing that the generated .redwood/schema.graphql
does not include directive usages on objects.
The directives themselves are defined, for example my generated file has:
directive @requireUserAuth(roles: [String]) on FIELD_DEFINITION
directive @skipAuth on FIELD_DEFINITION
But that is the only place those directives appear in the generated file. The directives are all working correctly, I’m just trying to understand why they are not in the generated file.
For example I have an SDL that includes:
type Query {
likes: [Like!]! @requireUserAuth
like(id: String!): Like @requireUserAuth
}
And in the generated file it’s:
type Query {
[...]
like(id: String!): Like
likes: [Like!]!
[...]
}
But what I was expecting to see was:
type Query {
[...]
like(id: String!): Like @requireUserAuth
likes: [Like!]! @requireUserAuth
[...]
}
The only directive I do see in the generated file is @deprecated
in a few places where we have used that.
Is this expected? Again, the directives are working fine. I’m just confused about where/how they are enforced (and I guess about what the function of .redwood/schema.graphql
is).