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

Mc/camelize directives #1302

Merged

Conversation

michaelcaterisano
Copy link
Contributor

@michaelcaterisano michaelcaterisano commented Feb 28, 2024

We're using custom schema directives in an Apollo federated schema. I noticed that multi-word directives were showing up as snake_case in the schema rather than camelCase. The change to notation.ex took care of camelCasing directives as defined in the sdl_render_test.exs, but the additional change in sdl_render.ex seemed to be necessary to camelCase custom schema directives defined in a federated subgraph. I'm not sure how to test that here since defining them relies on Apollo's composeDirective directive:

  extend schema do
    directive(:link, url: "https://specs.apollo.dev/federation/v2.5", import: ["@composeDirective"])
    directive(:link, url: "https://some-url.com", import: ["@disallowedForSubscriptions"])
    directive(:composeDirective, name: "@disallowedForSubscriptions")
  end

Any feedback would be appreciated cc: @benwilson512

* remove oopsies

* more whoops

camelize directives
@michaelcaterisano michaelcaterisano marked this pull request as ready for review February 28, 2024 21:43
Copy link
Contributor

@benwilson512 benwilson512 left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks!

@benwilson512 benwilson512 merged commit 747ba05 into absinthe-graphql:main Feb 28, 2024
@michaelcaterisano
Copy link
Contributor Author

michaelcaterisano commented Feb 28, 2024

@benwilson512 I assumed the tests would run in CI; I just ran the whole suite locally and it seems this broke some tests, specifically strict_schema_test.exs. I'm going to take a look now and see if I can figure out why they're failing. Feel free to revert if necessary while I look into it.

benwilson512 added a commit that referenced this pull request Feb 29, 2024
…tives

Fix #1302, camelize type system directives in sdl output
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.

2 participants