gqlgen
gqlgen copied to clipboard
Best way to implement namespace?
What happened?
Our graphql apis is expanding rapidly and we would like to start namespacing our operations as per https://www.apollographql.com/docs/technotes/TN0012-namespacing-by-separation-of-concern/
What did you expect?
A smooth developer experience without having to add lots of resolvers and complex.
Right now the number of resolvers and extra arguments needed to get this to work as well as gqlgen.yml or @goField
tags in confusing to a lot of the engineers.
Maybe we could introduce another internal directive like the goField such as a @namespace
that would allow for a better devex.
Minimal graphql.schema and models to reproduce
Given an accounts service
type Query {
accounts: AccountQueries!
}
type Mutation {
accounts: AccountMutations!
}
type AccountQueries {
getById(id: ID!): Account!
}
type AccountMutations {
create(input: AccountCreateInput!): Account!
}
type Account {
id: ID!
}
input AccountCreateInput {
email: String!
}
versions
Not relevant
+1
Any updates on this issues? We are facing the same problem in our project.
+1
+1, I tried namespacing the same way and the generated resolvers do not seem correct.
@macnibblet If you have a full working example (regardless of complexity), I would really like to see it.