3 ms·
This feels almost identical to GraphQL With GraphQL, you'd define types -- say something like: type User { id: ID name: String age
by gavinray 4y ago
This feels almost identical to GraphQL
With GraphQL, you'd define types -- say something like:
type User {
id: ID
name: String
age: Int
todos: Todo[]
}
type Todo {
id: ID
user_id: ID
text: String
is_completed: Boolean
}
These can be autogenerated based on, for instance, the tables in your SQL database
Then you can use tools to generate query functions, like:
query {
users(where: { age: { _lte: 25 } }) {
name
todos(where: { is_completed: { _eq: false } }) {
text
}
}
}
And finally generate a typed SDK so that operations are strongly-typed for whatever language it is you're using to query the GraphQL API