Crates.io | wasmer-api |
lib.rs | wasmer-api |
version | 0.1.0 |
source | src |
created_at | 2023-03-29 00:33:27.47046 |
updated_at | 2024-10-04 13:56:12.532833 |
description | Client library for the Wasmer GraphQL API |
homepage | https://wasmer.io/ |
repository | https://github.com/wasmerio/wasmer |
max_upload_size | |
id | 823571 |
size | 270,258 |
GraphQL API client for the Wasmer backend.
This client is built on the cynic crate, a GraphQL client library that allows tight integration between Rust and GraphQL types.
It was chosen over other implementations like graphql-client
because it
significantly reduces boilerplate and improves the development experience.
The downside is that the underlying GraphQL queries are much less obvious when looking at the code. This can be remedied with some strategies mentioned below.
Consult the Cynic docs at cynic-rs.dev for more information.
The GraphQL schema for the backend is stored in ./schema.graphql
.
To update the schema, simply download the latest version and replace the local file.
It can be retrieved from https://github.com/wasmerio/backend/blob/main/backend/graphql/schema.graphql.
You can use the Cynic web UI to easily create the types for new queries.
Simply upload the local schema from ./schema.graphql
and use the UI to build
your desired query.
NOTE: Where possible, do not duplicate types that are already defined, and instead reuse/extend them where possible.
This is not always sensible though, depending on which nested data you want to fetch.