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

Support graphql aliases on links_of_type #20

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

richardTowers
Copy link
Contributor

In some queries, we have:

parent_taxons: links_of_type(type: "parent_taxon")
child_taxons: links_of_type(type: "parent_taxon", reverse: true)

Which means that link type isn't enough to disambiguate one from the other. The alias has to be unique, so we can use that instead of the link type as the path key.

This means we have to mess around with ast_nodes a bit, which is ugly. But this whole implementation is ugly so ¯\_(ツ)_/¯

In some queries, we have:

parent_taxons: links_of_type(type: "parent_taxon")
child_taxons: links_of_type(type: "parent_taxon", reverse: true)

Which means that link type isn't enough to disambiguate one from the
other. The alias has to be unique, so we can use that instead of the
link type as the path key.

This means we have to mess around with ast_nodes a bit, which is ugly.
But this whole implementation is ugly so ¯\_(ツ)_/¯
@richardTowers richardTowers merged commit 763030d into main Feb 19, 2025
8 checks passed
@richardTowers richardTowers deleted the support-aliases branch February 19, 2025 11:06
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

Successfully merging this pull request may close these issues.

1 participant