Fully typed TypeScript GraphQL client (powered by GenQL) for Zeepkist, providing the GTR and Workshop GraphQL API for Zeepkist.
Download the GTR mod for Zeepkist in Modkist (Zeepkist's Mod Loader) or on mod.io
Please note that as this is an ever green package that automatically updates types when it detects the schemas change, breaking changes to the schema may occur in minor releases.
Explore and test your GraphQL queries on the GraphiQL IDE: https://graphql.zeepki.st
Use the online converter provided by GenQL to quickly convert a GrapQL query to a format usable by this library:
<script type="module">
import { client } from 'https://esm.run/@zeepkist/graphql'
const response = await client.query({
...
})
</script>
import { client } from 'https://esm.run/@zeepkist/graphql'
const response = await client.query({
...
})
yarn add @zeepkist/graphql
# or with npm:
npm install @zeepkist/graphql
import { client } from '@zeepkist/graphql'
const response = await client.query({
...
})
Enums can be imported, for example:
import {
client,
enumLevelsOrderBy,
RecordGenqlSelection,
QueryGenqlSelection,
} from '@zeepkist/graphql'
const recordFragment: RecordGenqlSelection = {
time: true,
user: {
steamId: true,
steamName: true,
}
}
const query: QueryGenqlSelection = {
levels: {
__args: {
first: 10,
orderBy: [enumLevelsOrderBy.LEVEL_POINT_COUNT_DESC]
},
nodes: {
personalBestGlobals: {
totalCount: true,
},
// Get the world record from the worldRecordGlobal
worldRecordGlobals: {
nodes: {
record: recordFragment
}
},
// Get the world record by filtering records for records that have a worldRecordGlobal relation
records: {
__args: {
filter: {
worldRecordGlobalsExist: true,
}
},
nodes: recordFragment
}
}
}
}
const response = await client.query({
__name: 'GetExampleQuery',
...query
})
To see all available exports and options, see the package documentation.
You will either need Node.js' CorePack enabled or an installation of pnpm to run this package locally. CorePack is recommended as it will automatically keep you updated with pnpm version the repository is using.
pnpm i
pnpm build
pnpm test
pnpm coverage
pnpm lint
pnpm generate