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

Allow JSON notation -> in column references for complex where conditions #1864

Merged
merged 13 commits into from May 31, 2021

Conversation

akyrey
Copy link
Contributor

@akyrey akyrey commented May 27, 2021

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Resolves #1863

Add a test to query inner JSON. This test also required defining a new Scalar type JSON (ref. https://gist.github.com/lorado/0519972d6fcf01f1aa5179d09eb6a315)

Changes

Edited regex to check column name validity

Breaking changes

No breaking changes

@spawnia spawnia marked this pull request as draft May 27, 2021 16:40
@akyrey
Copy link
Contributor Author

akyrey commented May 31, 2021

Should I update anything in the documentation?

@akyrey
Copy link
Contributor Author

akyrey commented May 31, 2021

Sorry for multiple pushes for Style CI

@spawnia spawnia changed the title Add JSON notation to assertValidColumnReference Allow JSON notation in column references for complex where conditions May 31, 2021
@spawnia spawnia changed the title Allow JSON notation in column references for complex where conditions Allow JSON notation -> in column references for complex where conditions May 31, 2021
@spawnia
Copy link
Collaborator

spawnia commented May 31, 2021

Sorry for multiple pushes for Style CI

StyleCI has an option to download a patch.

@spawnia spawnia added the bug An error within Lighthouse label May 31, 2021
@spawnia spawnia marked this pull request as ready for review May 31, 2021 10:26
@spawnia
Copy link
Collaborator

spawnia commented May 31, 2021

I saw you added a custom JSON type. It is not needed for purposes of this PR, but if you want to use one for your projects, I recommend https://github.com/mll-lab/graphql-php-scalars/blob/master/src/JSON.php

Note that I strongly recommend using actual types when you know the contents (don't be lazy), only resort to JSON when you have absolutely no idea what could be in there. Think of it as a more contrained version of String.

@spawnia spawnia merged commit f383116 into nuwave:master May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error within Lighthouse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query JSON column in whereConditions
2 participants