-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
GraphQL Tuples
At this stage, GraphQL does not provide tuples. This issue proposes to extend the GraphQL specification with an additional primitive type Tuple (of kind WRAPPER).
a GraphQL tuple (a₁,...,aₙ₋₁, type) is a list of fixed size n, where the first n-1 arguments can be either enum, scalar, or wrapper types, but the last argument can take any possible type.
accordingly, the selection will be applied only to the last argument.
For example a API with the following schema for query { users { name } }
type User {
name: String
age: Int
}
type Query {
users : [(ID!,User)]
}will produce the response:
{
"data": {
"users": [
["jkgad", { "name": "Alex" }],
["t9t98", { "name": "John" }],
]
}
}this way we can support a Map in GraphQL.
Additional considerations of syntax, semantics, and introspection are presented in the morpheus-graphql-proposals
shiro
Metadata
Metadata
Assignees
Labels
No labels