3 releases (breaking)

new 0.4.0 Dec 17, 2024
0.3.0 Dec 7, 2024
0.2.0 Oct 29, 2024

#717 in Web programming

Download history 150/week @ 2024-10-28 23/week @ 2024-11-04 6/week @ 2024-11-11 13/week @ 2024-11-18 22/week @ 2024-11-25 139/week @ 2024-12-02 59/week @ 2024-12-09

234 downloads per month
Used in wasmer-cli

MIT license

570KB
15K SLoC

Rust 12K SLoC // 0.0% comments GraphQL 4K SLoC

wasmer-backend-api

GraphQL API client for the Wasmer backend.

Development

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.

Backend GraphQL Schema

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.

Writing/Updating Queries

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.

Dependencies

~23–38MB
~607K SLoC