API

Every Graphcool service comes with two different GraphQL APIs. Note that both APIs still access the same underlying database!

The Simple API exposes simple and intuitive CRUD operations and supports realtime functionality based on GraphQL subscriptions. This should be the default for any consumer of the API that's not using Facebook's homegrown GraphQL client Relay.

If a requested fails, the JSON payload of the server's response will contain a root field called errors that contains precise information about the problems that occured on the server-side.

Since GraphQL allows for multiple operations to be sent in the same request, it's well possible that a request only partially fails and returns actual data and errors.

Notice that HTTP status codes are not relevant when using GraphQL! A GraphQL server will always respond with code 200 (unless an internal server occured, then it might be code 500). Any further information needs to be parsed from the JSON payload of the response.

Yes. Graphcool offers a realtime API based on GraphQL subscriptions. It allows you to subscribe to specific events that are happening in the backend, for example when database records are created, updated or deleted.

GraphQL subscriptions are extremely powerful. They not only allow to react to events, subscribers can also specify exactly the data they want to receive when the event occurs. This is done using regular GraphQL queries.

Graphcool is a backend development framework. As such, it's only concerned with the implementation of the web server and its API. Offline support is a question relating to the client-side, consequently Graphcool itself doesn't have any support for offline usage.

However, the communities around popular GraphQL clients like Apollo and Relay are already debating ways to solve this.

You can not change the auto-generated CRUD API that's generated by the GraphQL engine.

However, using Graphcool's API proxy layer, you can define your own GraphQL API and easily map it to the operations in the auto-generated CRUD API. You can also write your own Resolver functions to extend the capabilities of your API or "wrap" certain operations from the CRUD API.

#Some GraphQL tooling I'm using requires the full GraphQL schema. How can I get access to it?

The easiest way to download your GraphQL schema is by using the graphql-cli: