-
Our schema looks like this: type Product {
id: ID!
name: String!
}
type User {
id: ID!
firstName: String!
} The backend returns auto-increment IDs, we want to prefix them by type and currently, we're using directives for that: type Product {
id: ID! @uniqueID
name: String!
}
type User {
id: ID! @uniqueID
firstName: String!
} class UniqueIdDirective extends SchemaDirectiveVisitor {
visitFieldDefinition(...) {
...
}
} Is there a way to avoid adding |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes, you can use the new schema directive functionality that relies on mapSchema. https://www.graphql-tools.com/docs/schema-directives Note that you can use mapSchema to modify fields with or without inspecting the directives they have attached... |
Beta Was this translation helpful? Give feedback.
Yes, you can use the new schema directive functionality that relies on mapSchema.
https://www.graphql-tools.com/docs/schema-directives
Note that you can use mapSchema to modify fields with or without inspecting the directives they have attached...