You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type TimeScope {
ID: ID!
name: String
}
type App{
ID: ID!
name: String
time_range(start: String!, stop: String!): [TimeScope!]!
}
type Query{
App(appId: ID): App!
}
schema{
query: Query
}
does not generate a resolver for time_range by default. How am i supposed to access the start and stop parameters ?
I like my model to be generated, even if I know i can force the resolver generation through a graphql directive or the qglgen.yml it is quite cumbersome when you have a few of them.
What did you expect?
The resolver to be generated by default on each parameterized graphql field. Or one line of configuration to do that.
BTW: the yaml configuration is not documented anymore on the website, seems to have been moved away with the FAQ
versions
gqlgen version 0.13.0
go version 1.15.7
The text was updated successfully, but these errors were encountered:
AlexandreBossard
changed the title
How to get generator on paremeter filed
How to trigger generator generation on parameterized field
Feb 15, 2021
AlexandreBossard
changed the title
How to trigger generator generation on parameterized field
How to trigger resolver generation on parameterized field
Feb 15, 2021
Perhaps you could try the just merged #1725 if it helps with your case.
Otherwise it's not quite clear what your environment is, e.g. there's no gqlgen.yml. A minimal example hosted as a GitHub repository would be helpful in reproducing this.
Actually I found a fix to this: You can edit the generated App go struct (by moving it into a separate file) and remove the "time_range" field. When you run the generate command again, a getter method will be generated for the tim_range field which gets passed the correct arguments.
Anyways this behavior is somewhat unexpected since parameterized fields can never be represented by a field of a struct, but must have a getter method. Maybe it makes sense to leave out all parameterized fields from the structs by default and generate getter methods instead?
Or is this what #1725 does?
What happened?
the following schema:
does not generate a resolver for
time_range
by default. How am i supposed to access thestart
andstop
parameters ?I like my model to be generated, even if I know i can force the resolver generation through a graphql directive or the
qglgen.yml
it is quite cumbersome when you have a few of them.What did you expect?
The resolver to be generated by default on each parameterized graphql field. Or one line of configuration to do that.
BTW: the yaml configuration is not documented anymore on the website, seems to have been moved away with the FAQ
versions
gqlgen version
0.13.0go version
1.15.7The text was updated successfully, but these errors were encountered: