@devticon-os/graphql-codegen-axios 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
## graphql-codegen-axios
|
|
2
2
|
A code generation tool that generates an Axios SDK based on your GraphQL queries. This tool makes it easy to consume GraphQL APIs in your Axios projects by automatically generating code for querying your GraphQL API and mapping the results to JavaScript objects.
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
- Generates TypeScript code for querying GraphQL APIs with Axios.
|
|
6
|
-
- Supports the
|
|
6
|
+
- Supports the `@first`, `@firstOrFail`, and `@nonNullable` directives.
|
|
7
7
|
|
|
8
8
|
### Usage
|
|
9
9
|
To use graphql-codegen-axios, you need to have Node.js installed on your system.
|
|
@@ -12,23 +12,22 @@ Installation
|
|
|
12
12
|
You can install graphql-codegen-axios using npm:
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
npm install graphql-codegen-axios --save-dev
|
|
16
|
-
yarn add graphql-codegen-axios -D
|
|
17
|
-
pnpm add graphql-codegen-axios -D
|
|
15
|
+
npm install @devticon-os/graphql-codegen-axios --save-dev
|
|
16
|
+
yarn add @devticon-os/graphql-codegen-axios -D
|
|
17
|
+
pnpm add @devticon-os/graphql-codegen-axios -D
|
|
18
18
|
```
|
|
19
19
|
### Configuration
|
|
20
20
|
In your project's codegen.yml configuration file, add the following configuration:
|
|
21
21
|
|
|
22
22
|
```yml
|
|
23
|
-
overwrite: true
|
|
24
23
|
schema: https://your-graphql-api.com/graphql
|
|
25
24
|
documents: src/**/*.graphql
|
|
26
25
|
generates:
|
|
27
|
-
src/generated/graphql.ts:
|
|
28
|
-
plugins:
|
|
29
|
-
- typescript
|
|
30
|
-
- typescript-operations
|
|
31
|
-
- graphql-codegen-axios
|
|
26
|
+
src/generated/graphql.ts:
|
|
27
|
+
plugins:
|
|
28
|
+
- typescript
|
|
29
|
+
- typescript-operations
|
|
30
|
+
- @devticon-os/graphql-codegen-axios
|
|
32
31
|
```
|
|
33
32
|
You can customize the output file path and other settings as per your requirements.
|
|
34
33
|
|