21 releases

0.1.0-alpha.2 Apr 13, 2023
0.1.0-alpha.1 Mar 29, 2023
0.0.24 Mar 7, 2024
0.0.23 Dec 21, 2023
0.0.10 Jul 24, 2023

#498 in HTTP server

Download history 728/week @ 2023-12-03 1121/week @ 2023-12-10 2042/week @ 2023-12-17 388/week @ 2023-12-24 1531/week @ 2023-12-31 2078/week @ 2024-01-07 829/week @ 2024-01-14 711/week @ 2024-01-21 37/week @ 2024-01-28 6/week @ 2024-02-04 3/week @ 2024-02-11 25/week @ 2024-02-18 49/week @ 2024-02-25 153/week @ 2024-03-03 81/week @ 2024-03-10 20/week @ 2024-03-17

304 downloads per month
Used in 4 crates

MIT license

165KB
5K SLoC

GraphQL 3K SLoC Rust 2K SLoC // 0.0% comments

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/wapm.io-backend/blob/master/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

~15–30MB
~484K SLoC