tirumaraiselvan / graphql-engine

Blazing fast, instant realtime GraphQL APIs on Postgres with fine grained access control
https://hasura.io
Apache License 2.0
2 stars 0 forks source link

Remote arguments validations not supported for non-scalar types #9

Closed tirumaraiselvan closed 5 years ago

tirumaraiselvan commented 5 years ago

Remote arguments are able to validate scalar fields but not complex fields like List, Object etc

E.g.

type: create_remote_relationship
args:
  name: message
  table: profiles
  hasura_fields:
    - id
  remote_schema: my-remote-schema
  remote_field: messages
  remote_arguments:
    where:
      id:
        _eq: "$id"
tirumaraiselvan commented 5 years ago

Maybe the way to solve it is to re-use/take inspiration from GraphQL.Validate.InputValue module.

chrisdone commented 5 years ago

Copying my comment over from PR 1:

I think that if I extend the python fake graphql service to expect argument format like that, then it'll be easier to test for objects. Will we support lists? I don't see a reason not to, but you might? Will we support enums?

For later reference, can you point to an example of how I might do that on the python side? I'm not sure what to do in the python here. I'm confident I could figure out the Haskell side.

chrisdone commented 5 years ago

Copying @tirumaraiselvan's reply over:

True. We might need to support everything. For e.g. what if the join query is something like:

messages(include: [$id]) {
id
name
}

I can extend the python server to have more complicated types.

tirumaraiselvan commented 5 years ago

We do not have ENUM type which can be a hasura_field but an ENUM type might be used as a static value in the remote args.

chrisdone commented 5 years ago

Right, a static string value which could be passed to the remote server without issue... :thinking:

tirumaraiselvan commented 5 years ago

Closed by #11