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

Fix broken behavior for several options on the same node #105

Merged
merged 5 commits into from
Sep 24, 2021

Conversation

benjaminjkraft
Copy link
Collaborator

@benjaminjkraft benjaminjkraft commented Sep 17, 2021

Summary:

Previously, we actually allowed you to put several genqlient directives
on the same node, but the semantics were undocumented (and somewhat
confusing, when it comes to typename). In order to support directives
on input options, we're actually going to be encouraging this usage (see
notes in #14), so it's time to fix it. To avoid confusion, I just had
conflicting directives be an error, rather than defining which one
"wins". The same applies to specifying the same option several
times in one directive.

I also fixed two small bugs:

  • typename on an operation would incorrectly cascade down to
    all input types in a query (causing conflicts).
  • directive parse errors had useless positions, now they're correct

Test plan:

make check

Copy link
Member

@StevenACoffman StevenACoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks!

Comment on lines 40 to 41
# multiple directives on the same node ("b" and "c") must not conflict. Note
# that directives on nodes do apply to their "children", so "d" does not apply
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this means to say: Note that directives on nodes do NOT apply to their "children".

Base automatically changed from benkraft.custom-marshal to main September 24, 2021 18:16
Previously, we actually allowed you to put several genqlient directives
on the same node, but the semantics were undocumented (and somewhat
confusing, when it comes to `typename`).  In order to support directives
on input options, we're actually going to be encouraging this usage (see
notes in #14), so it's time to fix it.  To avoid confusion, I just had
conflicting directives be an error, rather than defining which one
"wins".

Test plan:
make check

Reviewers: steve, marksandstrom, jvoll, adam, miguel, mahtab
@benjaminjkraft benjaminjkraft merged commit 6e2b1a5 into main Sep 24, 2021
@benjaminjkraft benjaminjkraft deleted the benkraft.repeatable-options branch September 24, 2021 18:16
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.

3 participants