GraphQL reference

This section provides reference information for the FaunaDB GraphQL API.

You can find step-by-step GraphQL tutorials in the Tutorials section.

Supported scalar types

The GraphQL API supports the following built-in types:

  • Boolean: A value that represents true or false.

  • Date: A date value. The GraphQL API communicates and renders these as strings in the format yyyy-MM-dd, but they are stored as FQL dates.

  • Float: A 64-bit floating point number.

  • ID: A string representing a document’s reference, which has the field name _id.

  • Int: A 32-bit signed decimal integer number.

  • Long: A 64-bit signed decimal integer number.

  • String: A string of UTF-8 characters.

  • Time: A timestamp value. The GraphQL API communicates and renders these as strings in the format yyyy-MM-ddTHH:mm:ss.SSSZ, but they are stored as FQL timestamps.

Resources

For more general information about GraphQL, training, or the specification itself, see these resources:

There are a few online, interactive GraphQL interfaces. The one we recommend is GraphQL Playground. It is embedded into FaunaDB Console.

For developers, the FaunaDB GraphQL API should work with most GraphQL libraries. See the next section for known limitations.

Limitations

The FaunaDB GraphQL API is in its initial release. It is functional, and can handle most GraphQL workloads. However, there are some GraphQL features that are currently not supported:

  • Schemas do not support:

    • Custom directives

    • Custom interfaces

    • Custom scalars

    • Union types

  • No name can start with an underscore (_)

  • Subscriptions are not supported.

Also, FaunaDB GraphQL API can only work with the defined schema. Any existing collections, indexes, or functions that may exist in a database, that are not referenced in the GraphQL schema, are unavailable to GraphQL queries.

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!