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

Correctly handle self-recursive types automatically #152

Open
benjaminjkraft opened this issue Nov 2, 2021 · 2 comments
Open

Correctly handle self-recursive types automatically #152

benjaminjkraft opened this issue Nov 2, 2021 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Issues that anyone could pick up and implement if useful to them

Comments

@benjaminjkraft
Copy link
Collaborator

(Split from #149.)

If you have in your schema

input T {
  f: T  # or `f: T!`
}

then genqlient by default generates

struct T {
  F T
}

which does not compile. Of course you can manually add pointer: true, but we could just do that automatically because it's the only valid way to represent this. Apparently this comes up a lot with Hasura-generated schemas, so although it seems a bit special-casey it's probably worth handling.

@benjaminjkraft benjaminjkraft added enhancement New feature or request good first issue Good for newcomers help wanted Issues that anyone could pick up and implement if useful to them labels Nov 2, 2021
@nedredmond
Copy link

@benjaminjkraft, Was this issue resolved by #155 ?

@benjaminjkraft
Copy link
Collaborator Author

#155 is one way to handle it, but this is a case where we can do even better without configuration, so that's what this issue tracks. (More discussion is in #149.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Issues that anyone could pick up and implement if useful to them
Projects
None yet
Development

No branches or pull requests

2 participants