GraphQL: A data query language
11–20 of 84 posts
Re: GraphQL: A data query language
#12I keep hearing people say things along the lines of, "Relay looks great, but I don't want to store my data in a graph". My impression is that GraphQL has nothing to do with graphs, really - it's a bit more like SchemaQL if anything. Could someone from the facebook team clarify about the name?
Re: GraphQL: A data query language
#13Are there still problems with GET requests not allowing very much data in the request? Will I have to send this as a POST, or is that all 200x?
https://github.com/facebook/relay/blob/master/src/network-la...
Re: GraphQL: A data query language
#14The language seems rather limited.
Re: GraphQL: A data query language
#15Re: GraphQL: A data query language
#16Why mirror the structure, but not syntactic details, of JSON (or YML) in the pretty printing? It's true that we've passed peak colon as a culture, and need to start reimagining life in a post-colonial way, but...
We've got a reference lexer and parser in JS at https://github.com/graphql/graphql-js/tree/master/src/langua..., and we have a parser in C++ with C and C++ APIs (that can be used to build a parser for other languages) at https://github.com/graphql/libgraphqlparser.
Re: GraphQL: A data query language
#17Are there still problems with GET requests not allowing very much data in the request? Will I have to send this as a POST, or is that all 200x?
Are you talking about the size limit (of about 2000 chars) on url strings? That's not a GraphQL thing, that's a limit imposed by certain browsers. If your request data might be bigger then it needs to be in a POST.
Ok. I was hoping things had gotten better.
Re: GraphQL: A data query language
#18I wonder how access controls will work in GraphQL/Relay.
The GraphQL server can pass down authentication information through the query using `rootValue` (for example, it might pass the OAuth access token that the client provided in the request), which the mapping from GraphQL-to-application-code can pass to the application code's access controls.
Re: GraphQL: A data query language
#19I keep hearing people say things along the lines of, "Relay looks great, but I don't want to store my data in a graph". My impression is that GraphQL has nothing to do with graphs, really - it's a bit more like SchemaQL if anything. Could someone from the facebook team clarify about the name?
Yep, GraphQL is agnostic as to how your data is stored. For example, https://github.com/graphql/swapi-graphql/ is a GraphQL schema that is backed by the swapi.co API. The examples at https://github.com/graphql/graphql-js/blob/master/src/__test... are backed by in-memory JSON objects. At Facebook, we have GraphQL types backed by data stored in a number of backends, including types backed by SQL tables.
Re: GraphQL: A data query language
#20What about inequality operators (>, >=, What about complex predicates (and, or)? The language seems rather limited.
For example, we might have the following query on Facebook's GraphQL schema:
{
user(id: 4) {
followers(isViewerFriend: true, birthdaysInRange: {before: -2, after: 2} orderBy:NAME) {
name
}
}
}
EDIT: fix code formattingWhich fetches Zuck's followers, and filters it to only my friends, and only those friends whose birthdays are within two days of today, and then orders them by name.
The `isViewerFriend`, `birthdaysInRange` and `orderBy` parameters were explicitly added to the API by the API developer for clients to use.
So clients don't have the ability to do arbitrary operators, but we also know that the client is only using functionality in the API that the API developer chose explicitly to allow.