Retrieve input received at grand-parent resolver in grand-child resolver. #2159
Unanswered
sujayramesh
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What happened?
Our schema has chain resolvers in which each resolver expects an input from user.
Schema snapshot below.
type Query {
a(Id: String): [Apm!]!
}
type A {
id: String!
ns(nsp: String): [N!]!
}
type N {
name: String!
ap(appl: String): [App!]!
}
type App {
name: String!
cS(): CentScan
}
type CentScan {
name: String!
address: String!
}
As per schema, types 'a', 'ns', 'ap' receive input from the user.
Also, tried inserting data into ctx but the resolvers seem to pass a local copy.
Ex:
func (r *aResolver) Ns(ctx context.Context, obj *model1.A, ns *string)
Any changes made inside resolver would not be propagated to further calls.
Request to suggest a solution.
What did you expect?
Retrieve input of 'a', 'ns' and 'ap' at cS or CentScan type.
Minimal graphql.schema and models to reproduce
type Query {
a(Id: String): [Apm!]!
}
type A {
id: String!
ns(nsp: String): [N!]!
}
type N {
name: String!
ap(appl: String): [App!]!
}
type App {
name: String!
cS(): CentScan
}
type CentScan {
name: String!
address: String!
}
versions
go run github.com/99designs/gqlgen version
?v0.17.2
go version
?go1.18
Beta Was this translation helpful? Give feedback.
All reactions