Getting started
Installation#
Install the following dependencies to your project:
- pnpm
- npm
- yarn
Command#
After @gqless/cli is installed in your package, you should add a script in your package.json.
Then, you can execute:
- pnpm
- npm
- yarn
Codegen#
gqless requires information about your schema, which is generated using the CLI.
After executing gqless generate for the first time, it will create a new configuration file named gqless.config.cjs at the root of your project, it will look like this:
You can also use the
gqlesskey in yourpackage.json, or use the namegqless.config.js
You can then modify the configuration based on your needs, at least changing introspection.endpoint.
If you leave enabled "react" and/or "subscriptions", you will also need to install these libraries:
- pnpm
- npm
- yarn
And then run the script to generate your schema:
- pnpm
- npm
- yarn
The gqless client will be created in your specified destination, which by default is src/gqless/index.ts, following the structure:
Usage#
Ensure that the queryFetcher in src/gqless/index.ts is correct.
You should then be able to use the client โจ