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

Ensure input/output types are correctly placed for SDL schemas #1142

Conversation

maartenvanvliet
Copy link
Contributor

The InputOutputTypesCorrectlyPlaced phase did not work for
SDL schema's since it would unwrap a TypeReference, which
yields the TypeReference and not the atom type identifier.

The subsequent lookup in the schema types would therefore fail, as
it expects atoms not typereferences, and it would not add errors.

It now correctly fetches the atom type identifier, though in a bit of
a roundabout way.

The InputOutputTypesCorrectlyPlaced phase did not work for
SDL schema's since it would unwrap a TypeReference, which
yields the TypeReference and not the type atom.

The subsequent lookup in the schema types would therefore fail, as
it expects atoms not typereferences, and it would not add errors.

It now correctly fetches the atom type identifier, though in a bit of
a roundabout way.
end

test "is enforced with input types on arguments" do
assert_schema_error("invalid_input_types_sdl", [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test asserts there are two errors, whilst the macro based schema only has one. This points to an issue with the macro based schema in that input object fields are FieldDefinition structs and not InputValueDefinition structs like there are in the SDL schema.

@benwilson512 benwilson512 merged commit 75c717d into absinthe-graphql:master Jan 18, 2022
@benwilson512
Copy link
Contributor

Thank you!

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.

None yet

2 participants