31 releases

0.1.0 Oct 4, 2024
0.1.0-alpha.2 Apr 13, 2023
0.1.0-alpha.1 Mar 29, 2023
0.0.34 Sep 9, 2024
0.0.10 Jul 24, 2023

#1316 in HTTP server

Download history 72/week @ 2024-08-23 10/week @ 2024-08-30 124/week @ 2024-09-06 59/week @ 2024-09-13 35/week @ 2024-09-20 38/week @ 2024-09-27 176/week @ 2024-10-04 19/week @ 2024-10-11 8/week @ 2024-10-18 1/week @ 2024-10-25 51/week @ 2024-12-06

51 downloads per month
Used in 3 crates

MIT license

380KB
11K SLoC

Rust 7K SLoC // 0.0% comments GraphQL 3.5K SLoC

wasmer-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

~18–31MB
~484K SLoC