Getting started
#
Installation- Go to the root of your project, and run:
- pnpm
- npm
- yarn
- Next, add a
script
field to your package.json: - Then run the script once, to create a
gqless.config.cjs
file:- pnpm
- npm
- yarn
#
Configuring CodegenThe default config should look something like this:
can also be specified in
package.json
viagqless
key
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 startedConfigure 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.
#
UsageSee one of the following for more: