Getting started
Installation#
- Go to the root of your project, and run:
- pnpm
- npm
- yarn
- Next, add a
scriptfield to your package.json: - Then run the script once, to create a
gqless.config.cjsfile:- pnpm
- npm
- yarn
Configuring Codegen#
The default config should look something like this:
can also be specified in
package.jsonviagqlesskey
Point introspection.endpoint to your GraphQL API, adding headers for authorization if necessary. Then run the generate command again, to fetch your schema and output to the destination file:
- pnpm
- npm
- yarn
The output should look like this:
Getting started#
Configure the fetch() call to your GraphQL server, located inside the queryFetcher() method within src/gqless/index.ts. You might for instance want to dynamically generate the URL depending on environment, or connect it up to your apps authorization.
Usage#
See one of the following for more: