Web integrations
Although you can use package:leto_schema
to create and validate schemas and package:leto
to execute GraphQL requests in any Dart application, GraphQL servers are usually deployed to the web. We provide a couple of utilities and integrations for creating and using GraphQL web servers powered by Leto.
Server integrations
Shelf
Using the shelf package.
- HTTP POST and GET
- Mutipart requests for file Upload.
- Subscriptions through WebSockets. Supporting graphql-ws and graphql-transport-ws subprotocols
- Batched queries
- TODO: HTTP/2 example
- TODO: Server-Sent Events
Web UI Explorers
These web pages will allow you to explore your GraphQL Schema, view all the types and fields, read each element's documentation, and execute requests against a GraphQL server.
Usually exposed as static HTML in your deployed server. Each has multiple configurations for determining the default tabs, queries and variables, the GraphQL HTTP and WebSocket (subscription) endpoints, the UI's theme and more.
All of the static HTML files and configurations can be found in the graphql_ui folder.
GraphiQL
Documentation. Use graphiqlHandler
. The classic GraphQL explorer
Playground
Documentation. Use playgroundHandler
. Support for multiple tabs, subscriptions.
Altair
Documentation. Use altairHandler
. Support for file Upload, multiple tabs, subscriptions, plugins.
Clients
For a complete GraphQL client you probably want to use:
Artemis (https://github.com/comigor/artemis)
package:graphql
(https://pub.dev/packages/graphql) withpackage:graphql_codegen
(https://pub.dev/packages/graphql_codegen)or raw gql Links (https://github.com/gql-dart/gql/tree/master/links)
gql Links are used by Ferry and Artemis, both of which provide additional functionalities over raw gql Links like serialization and deserialization, code generation, type safety, normalized caching and more.