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 Report

Merging #255 (34dd205) into master (37f1917) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #255   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines         1404      1436   +32     
=========================================
+ Hits          1404      1436   +32     
Impacted Files Coverage Δ
gql/dsl.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 37f1917...34dd205. Read the comment docs.

@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