Powered by Genql
GraphQL client for the
wapm.io API

API for the wapm registry.

This SDK was created from the wapm.io GraphQL API with Genql.

This library is fully type safe and thanks to TypeScript auto completion you can discover fields and methods very easily.

How to install

Use a package manager to install the API client
bash
npm install @genql/wapm-registry

Using the client

Use a package manager to install the API client
typescript
import { createClient } from '@genql/wapm-registry' const client = createClient()

Passing headers

You can use the headers options to pass credentials or other headers
typescript
import { createClient } from '@genql/wapm-registry' const client = createClient({ headers: { Authorization: `Bearer ${Token}` } })

Example queries

This SDK is generated from the wapm.io GraphQL API so the client has a structure similar to the one used by GraphQL queries.

To fetch fields you need to explicitly pass field: true, you can also pass __args to fetch all scalar fields on a type.

Notice that to pass arguments you can use __args

typescript
import { createClient } from '@genql/wapm-registry' const client = createClient() // query variables let size = 3 let input client .mutation({ acceptNamespaceCollaboratorInvite: { __args: { input: input, }, clientMutationId: true, namespaceCollaboratorInvite: { accepted: { createdAt: true, id: true, }, approvedBy: { avatar: { __args: { size: size, }, }, }, closedAt: true, }, }, }) .then((x) => console.log(JSON.stringify(x, null, 4))) // query variables let size = 3 let input client .mutation({ acceptPackageCollaboratorInvite: { __args: { input: input, }, clientMutationId: true, packageCollaboratorInvite: { accepted: { createdAt: true, id: true, }, approvedBy: { avatar: { __args: { size: size, }, }, }, closedAt: true, }, }, }) .then((x) => console.log(JSON.stringify(x, null, 4)))

More usage examples

This SDK was created using Genql so you can find more usage examples in the main Genql website and docs
Resources
Who made this?
Proudly sponsored by Notaku