Skip to content

DSL serialize complex arguments to literals #255

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

Conversation

leszekhanusz
Copy link
Collaborator

@leszekhanusz leszekhanusz commented Nov 15, 2021

NOTE: This PR depends on PR #253 and should be merged after it !

This is a new feature for the DSL module which will attempt to serialize complex objects as literal (inside the query itself)
when provided as arguments of DSLFields.

It should fix #137

Note:

  • some scalars could have different serialization as variable values or as literals (it should be quite rare in practice). In that case, this method does not work.
  • there are some limitations, not all json values can be converted as literal inside the query (for example if the json value contain object with keys with spaces)
  • once the graphql-js PR 3065 has been merged, and ported to graphql-core, then we could use it to allow custom serialization to literals for custom scalars

@leszekhanusz leszekhanusz requested a review from Cito November 15, 2021 17:03
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (37f1917) to head (34dd205).
Report is 187 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #255   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines         1404      1436   +32     
=========================================
+ Hits          1404      1436   +32     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leszekhanusz leszekhanusz merged commit d1ba78d into graphql-python:master Nov 19, 2021
@lenoirmind
Copy link

lenoirmind commented Dec 2, 2021 via email

@leszekhanusz leszekhanusz deleted the feature_dsl_serialize_to_literals branch March 12, 2022 12:43
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.

SequelizeJSON support
3 participants