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

Map Values as Scalars Support #575

Closed
xsoufiane opened this issue Feb 2, 2021 · 1 comment
Closed

Map Values as Scalars Support #575

xsoufiane opened this issue Feb 2, 2021 · 1 comment

Comments

@xsoufiane
Copy link

Currently, Sangria doesn't support map values as scalars. The choice was made to preserve security, e.g., prevent NoSQL Injections as discussed here. However, to be able to use Apollo federation on top of Sangria, there is a need for accepting map values (json objects) as scalars. The federation issue was raised here.

Now, I opened this issue to keep track of the efforts that are being done to solve it without opening the security hole.

Details

Let's consider the following schema:

scalar _Any
type Query {
  _entities(representations: [_Any!]!): [_Entity]!
} 

By solving this issue, we will be able to perform the following queries:

{
  "query": "query($representations: [_Any!]!) {...}"
  "variables": {
    "_representations": [
      {
        "__typename": "Product",
        "upc": "B00005N5PF"
      },
      ...
    ]
  }
}

or using the input object notation:

{
  _entities(representations: [{__typename: "State", id: 0}]) {...}
}
@xsoufiane
Copy link
Author

A solution for the issue :) is currently being implemented here

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

1 participant