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

Support for JSON input type in Smallrye Graphql #1776

Open
pipinet opened this issue Mar 12, 2023 · 7 comments
Open

Support for JSON input type in Smallrye Graphql #1776

pipinet opened this issue Mar 12, 2023 · 7 comments

Comments

@pipinet
Copy link
Contributor

pipinet commented Mar 12, 2023

https://github.com/graphql-java/graphql-java-extended-scalars
image

@debu999
Copy link
Contributor

debu999 commented Mar 16, 2023

I did create on same lines 👍
#1773

@debu999
Copy link
Contributor

debu999 commented May 31, 2023

Is there any update on this? @t1

@jmartisk
Copy link
Member

jmartisk commented May 31, 2023

With @mskacelik we tried experimenting with this, but hit an issue because JsonObject extends Map<String, JsonValue>, and for maps we already have a custom handling logic that is incompatible with this.

For example, a map containing a key "a" and value "b" is currently mapped to a GraphQL object like this

[
  {
     "key": "a",
     "value": "b"
  }
]

whereas the logical JSON object would be

{ "a": "b"}

we weren't yet sure how to properly resolve this conflict without breaking backwards compatibility.

@debu999
Copy link
Contributor

debu999 commented Jun 17, 2023

May be a user defined property to enable map mapper will be good. Since everyone using smallrye-graphql are used to Map = [{key: a, value: b}] they should do a parsing as needed.
It might be something for inputs though to do parsing a JSON

@phillip-kruger
Copy link
Member

phillip-kruger commented Jun 19, 2023

Users can provide their own mapper for Maps, overriding the default built-in one

@cristianonicolai
Copy link
Contributor

Also have a use case where we would need to allow for generic JSON to be passed on as part of the query input. We use dynamic variable names and paths that users could filter on, so using JSON scalar could be of benefit here.

@debu999
Copy link
Contributor

debu999 commented Jan 6, 2024

I was reading how it was done in spqr this seems to be a mapper for GSON and JACKSON.
leangen/graphql-spqr@5244588

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

No branches or pull requests

5 participants