Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@requires directive breaks code generation when @entityResolver is used #1832

Closed
chedom opened this issue Jan 20, 2022 · 0 comments
Closed

Comments

@chedom
Copy link
Contributor

chedom commented Jan 20, 2022

What happened?

@requires directive breaks code generation when @entityResolver is used.
Geneation brakes with an error:

federation: federation.gotpl: template: federation.gotpl:160:18: executing "federation.gotpl" at <.Fields>: can't evaluate field Fields in type *federation.Requires

What did you expect?

Resolvers should be generated.

Minimal graphql.schema and models to reproduce:

  1. Go to plugin/federation
  2. Add next type to testdata/entityresolver/schema.graphql
type MultiHelloRequires @key(fields: "name") @entityResolver(multi: true) {
    name: String! @external
    key1: String! @external
    key2: String! @requires(fields: "key1")
}
  1. Run the command go generate

Got: federation: federation.gotpl: template: federation.gotpl:160:18: executing "federation.gotpl" at <.Fields>: can't evaluate field Fields in type *federation.Requires
Expected: no error

versions

  • gqlgen version : v0.15.1
  • go version: 1.17.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant