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

Build type __reference__ values for SDL-generated types #635

Merged
merged 2 commits into from
Nov 15, 2018

Conversation

bruce
Copy link
Contributor

@bruce bruce commented Nov 15, 2018

This PR calculates __reference__ values for types created by import_sdl/2, with specialized support for the :path option (so schema validation errors will reference the source .graphql file & line). Various parts of Absinthe assume __reference__ is set.

Aside: @benwilson512 and I have discussed reassessing how we use __reference__ and __private__ (and source_location, likely), considering some conflation in use.

@bruce bruce self-assigned this Nov 15, 2018
@bruce bruce merged commit 8b7bcee into master Nov 15, 2018
@benwilson512 benwilson512 deleted the fix-sdl-field-def-reference branch November 15, 2018 21:44
end

@spec import_sdl(String.t() | Macro.t(), [import_sdl_option()]) :: Macro.t()
defmacro import_sdl(sdl, opts \\ []) do
do_import_sdl(sdl, opts)
__CALLER__
|> do_import_sdl(sdl, opts)
Copy link
Contributor

Choose a reason for hiding this comment

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

@bruce ah yeah this is definitely the right thing to do here.

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