GraphQL API
The most powerful API for accessing your WebAssembly modules, now completely open for all to use
All WAPM services (accessible via both the registry frontend wapm.io and the CLI client wapm-cli) use the WAPM GraphQL API to interact with and retrieve data from the WAPM Registry.
What is GraphQL?
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.
If you want to learn more about GraphQL, please visit the official Website: GraphQL.org
How I can use the WAPM API?
The WAPM GraphQL API (and the GraphiQL IDE) can be accessed here:
****registry.wapm.io/graphql****
Did you know...?
WebAssembly.sh is using the WAPM GraphQL API to automatically expose the WASI modules and commands in the online shell
Examples
Let's see now a few things that we can do with it!
Get a Package Version
We can do a POST to https://registry.wapm.io/graphql with the the following as the query
POST field:
Which should return something similar to:
Get all Packages for a given Interface
If we want to search all the packages published that have certain interface (for example, WASI), we can do a POST to https://registry.wapm.io/graphql with the the following as the query
POST field:
Which should return something similar to:
Happy hacking! 🎉
Last updated