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

Fixed wrong scalar types into variables for ra-data-graphql-simple #3036

Merged
merged 7 commits into from
Apr 2, 2019
Merged

Fixed wrong scalar types into variables for ra-data-graphql-simple #3036

merged 7 commits into from
Apr 2, 2019

Conversation

Artexoid
Copy link
Contributor

The fix for GraphQL version 14.0.0+ related scalar value coercion. The current version doesn't work correctly. GraphQL changes: https://www.libupdate.com/libs/1c88bd1e-024d-41aa-9241-c29cd6d5f0c5

@djhi
Copy link
Contributor

djhi commented Mar 21, 2019

Sorry, the tests are currently a PITA to maintain. I'll have to clear some of them.

Copy link
Contributor

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Thanks! Can you please run prettier on this file? There is a make command for it, and a yarn one if you can't run make

@Artexoid
Copy link
Contributor Author

@djhi Also, I fixed a little bug for it

@Artexoid
Copy link
Contributor Author

Artexoid commented Mar 21, 2019

Thanks! Can you please run prettier on this file? There is a make command for it, and a yarn one if you can't run make

Ok, I'll do it now

@djhi
Copy link
Contributor

djhi commented Mar 21, 2019

Btw, I'm afraid this will be a breaking change for those who haven't upgraded their graphql package. Can you confirm ?

@Artexoid
Copy link
Contributor Author

Artexoid commented Mar 21, 2019

Btw, I'm afraid this will be a breaking change for those who haven't upgraded their graphql package. Can you confirm ?

@djhi It works well for me. I tested it with graphql@0.13.2 and graphql@14.1.1 . The update related only with scalar values coercion to correctly types.

Started from version 14.0.0 graphQL server throws an error if the client sends in variables wrong type. For example on the server args:

{
  id: Int
}

And the client sends:

{
  "id": "24"
}

It will work before version 14.0.0, but started from version 14.0.0 the server will return error "wrong type".

Just need to complete tests with green result :-)

@Artexoid
Copy link
Contributor Author

It will works for old GraphQL packages too

@fzaninotto fzaninotto merged commit 4d532c0 into marmelab:master Apr 2, 2019
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 2.8.5 milestone Apr 2, 2019
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

3 participants