Every Graphcool service comes with two different GraphQL APIs. Note that both APIs still access the same underlying database!
Graphcool conforms to the GraphQL specification for error handling.
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.
This is absolutely possible and there are essentially two ways of achieving it:
In any case, the result will be that the external functionality you want to integrate will become part of your GraphQL API.
This is an extremely powerful feature that allows to hide the complexity of interacting with many independent systems behind a single, coherent GraphQL API!
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.
Was this page helpful?