News for hackers. Stuff that matters.
Re:GraphQL: A data query language by dschafer on Monday September 14, 2015 @07:56PM (#10218225)
When building out a GraphQL schema, the schema developer chooses which functionality to expose to the client. So rather than having the client do operations or predicates directly, the server declares what functionality is available, and might expose functionality that ordinarily would have used operators or predicates.

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 formatting

Which 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.

Re:GraphQL: A data query language by 15155 on Monday September 14, 2015 @09:30PM (#10218513)
Any idea when this will work with Relay?
Re:GraphQL: A data query language by masterj on Monday September 14, 2015 @10:24PM (#10218665)
This is how Relay currently works
Re:GraphQL: A data query language by 15155 on Monday September 14, 2015 @10:43PM (#10218712)
You can't presently pass other filtering arguments to a relay query. Just IDs.

Unless I am missing something, the above query wouldn't work in Relay.

Re:GraphQL: A data query language by TheMakeA on Monday September 14, 2015 @11:22PM (#10218802)
You totally can. One restriction (that you might be confused with) is that Relay currently only supports root fields with a single argument (which would typically be an ID).

But arbitrary arguments on any other field are totally supported.