@manuelp1345/graph-generator 1.0.0
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/codegen.ts +33 -0
- package/dist/generated.js +53 -0
- package/dist/index.js +2 -0
- package/dist/user/hook.js +8 -0
- package/package.json +25 -0
- package/src/generated.tsx +498 -0
- package/src/index.ts +2 -0
- package/src/user/hook.ts +10 -0
- package/src/user/queries.graphql +6 -0
- package/tsconfig.json +20 -0
package/codegen.ts
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
import dotenv from "dotenv";
|
2
|
+
import type { CodegenConfig } from "@graphql-codegen/cli";
|
3
|
+
|
4
|
+
dotenv.config({ path: "./.env" });
|
5
|
+
|
6
|
+
const schema = process.env.SCHEMA_URL || "http://localhost:4000/graphql";
|
7
|
+
|
8
|
+
const config: CodegenConfig = {
|
9
|
+
overwrite: true,
|
10
|
+
schema: schema,
|
11
|
+
documents: ["./src/**/*.graphql"],
|
12
|
+
ignoreNoDocuments: true,
|
13
|
+
generates: {
|
14
|
+
"./src/generated.tsx": {
|
15
|
+
plugins: [
|
16
|
+
"typescript",
|
17
|
+
"typescript-operations",
|
18
|
+
"typescript-react-apollo",
|
19
|
+
],
|
20
|
+
config: {
|
21
|
+
withHooks: true,
|
22
|
+
withHOC: false,
|
23
|
+
withComponent: false,
|
24
|
+
namingConvention: {
|
25
|
+
typeNames: "change-case#pascalCase",
|
26
|
+
enumValues: "change-case#upperCase",
|
27
|
+
},
|
28
|
+
},
|
29
|
+
},
|
30
|
+
},
|
31
|
+
};
|
32
|
+
|
33
|
+
export default config;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { gql } from '@apollo/client';
|
2
|
+
import * as Apollo from '@apollo/client';
|
3
|
+
const defaultOptions = {};
|
4
|
+
export var NullsOrder;
|
5
|
+
(function (NullsOrder) {
|
6
|
+
NullsOrder["FIRST"] = "first";
|
7
|
+
NullsOrder["LAST"] = "last";
|
8
|
+
})(NullsOrder || (NullsOrder = {}));
|
9
|
+
export var SortOrder;
|
10
|
+
(function (SortOrder) {
|
11
|
+
SortOrder["ASC"] = "asc";
|
12
|
+
SortOrder["DESC"] = "desc";
|
13
|
+
})(SortOrder || (SortOrder = {}));
|
14
|
+
export var UserScalarFieldEnum;
|
15
|
+
(function (UserScalarFieldEnum) {
|
16
|
+
UserScalarFieldEnum["ID"] = "id";
|
17
|
+
UserScalarFieldEnum["NAME"] = "name";
|
18
|
+
})(UserScalarFieldEnum || (UserScalarFieldEnum = {}));
|
19
|
+
export const GetUsersDocument = gql `
|
20
|
+
query GetUsers {
|
21
|
+
users {
|
22
|
+
id
|
23
|
+
name
|
24
|
+
}
|
25
|
+
}
|
26
|
+
`;
|
27
|
+
/**
|
28
|
+
* __useGetUsersQuery__
|
29
|
+
*
|
30
|
+
* To run a query within a React component, call `useGetUsersQuery` and pass it any options that fit your needs.
|
31
|
+
* When your component renders, `useGetUsersQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
32
|
+
* you can use to render your UI.
|
33
|
+
*
|
34
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
35
|
+
*
|
36
|
+
* @example
|
37
|
+
* const { data, loading, error } = useGetUsersQuery({
|
38
|
+
* variables: {
|
39
|
+
* },
|
40
|
+
* });
|
41
|
+
*/
|
42
|
+
export function useGetUsersQuery(baseOptions) {
|
43
|
+
const options = Object.assign(Object.assign({}, defaultOptions), baseOptions);
|
44
|
+
return Apollo.useQuery(GetUsersDocument, options);
|
45
|
+
}
|
46
|
+
export function useGetUsersLazyQuery(baseOptions) {
|
47
|
+
const options = Object.assign(Object.assign({}, defaultOptions), baseOptions);
|
48
|
+
return Apollo.useLazyQuery(GetUsersDocument, options);
|
49
|
+
}
|
50
|
+
export function useGetUsersSuspenseQuery(baseOptions) {
|
51
|
+
const options = baseOptions === Apollo.skipToken ? baseOptions : Object.assign(Object.assign({}, defaultOptions), baseOptions);
|
52
|
+
return Apollo.useSuspenseQuery(GetUsersDocument, options);
|
53
|
+
}
|
package/dist/index.js
ADDED
package/package.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"name": "@manuelp1345/graph-generator",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "generador de schema y types de graphql",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"scripts": {
|
7
|
+
"codegen": "graphql-codegen --config codegen.ts",
|
8
|
+
"build": "tsc",
|
9
|
+
"prepublishOnly": "npm run codegen && npm run build"
|
10
|
+
},
|
11
|
+
"keywords": [],
|
12
|
+
"author": "manuelDev",
|
13
|
+
"license": "ISC",
|
14
|
+
"dependencies": {
|
15
|
+
"@graphql-codegen/cli": "^5.0.3",
|
16
|
+
"@graphql-codegen/typescript": "^4.1.2",
|
17
|
+
"@graphql-codegen/typescript-operations": "^4.4.0",
|
18
|
+
"@graphql-codegen/typescript-react-apollo": "^4.3.2",
|
19
|
+
"dotenv": "^16.4.7"
|
20
|
+
},
|
21
|
+
"publishConfig": {
|
22
|
+
"access": "public"
|
23
|
+
},
|
24
|
+
"devDependencies": {}
|
25
|
+
}
|
@@ -0,0 +1,498 @@
|
|
1
|
+
import { gql } from '@apollo/client';
|
2
|
+
import * as Apollo from '@apollo/client';
|
3
|
+
export type Maybe<T> = T | null;
|
4
|
+
export type InputMaybe<T> = Maybe<T>;
|
5
|
+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
6
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
7
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
8
|
+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
9
|
+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
10
|
+
const defaultOptions = {} as const;
|
11
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
12
|
+
export type Scalars = {
|
13
|
+
ID: { input: string; output: string; }
|
14
|
+
String: { input: string; output: string; }
|
15
|
+
Boolean: { input: boolean; output: boolean; }
|
16
|
+
Int: { input: number; output: number; }
|
17
|
+
Float: { input: number; output: number; }
|
18
|
+
};
|
19
|
+
|
20
|
+
export type AffectedRowsOutput = {
|
21
|
+
__typename?: 'AffectedRowsOutput';
|
22
|
+
count: Scalars['Int']['output'];
|
23
|
+
};
|
24
|
+
|
25
|
+
export type AggregateUser = {
|
26
|
+
__typename?: 'AggregateUser';
|
27
|
+
_avg?: Maybe<UserAvgAggregate>;
|
28
|
+
_count?: Maybe<UserCountAggregate>;
|
29
|
+
_max?: Maybe<UserMaxAggregate>;
|
30
|
+
_min?: Maybe<UserMinAggregate>;
|
31
|
+
_sum?: Maybe<UserSumAggregate>;
|
32
|
+
};
|
33
|
+
|
34
|
+
export type CreateManyAndReturnUser = {
|
35
|
+
__typename?: 'CreateManyAndReturnUser';
|
36
|
+
id: Scalars['Int']['output'];
|
37
|
+
name?: Maybe<Scalars['String']['output']>;
|
38
|
+
};
|
39
|
+
|
40
|
+
export type IntFilter = {
|
41
|
+
equals?: InputMaybe<Scalars['Int']['input']>;
|
42
|
+
gt?: InputMaybe<Scalars['Int']['input']>;
|
43
|
+
gte?: InputMaybe<Scalars['Int']['input']>;
|
44
|
+
in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
45
|
+
lt?: InputMaybe<Scalars['Int']['input']>;
|
46
|
+
lte?: InputMaybe<Scalars['Int']['input']>;
|
47
|
+
not?: InputMaybe<NestedIntFilter>;
|
48
|
+
notIn?: InputMaybe<Array<Scalars['Int']['input']>>;
|
49
|
+
};
|
50
|
+
|
51
|
+
export type IntWithAggregatesFilter = {
|
52
|
+
_avg?: InputMaybe<NestedFloatFilter>;
|
53
|
+
_count?: InputMaybe<NestedIntFilter>;
|
54
|
+
_max?: InputMaybe<NestedIntFilter>;
|
55
|
+
_min?: InputMaybe<NestedIntFilter>;
|
56
|
+
_sum?: InputMaybe<NestedIntFilter>;
|
57
|
+
equals?: InputMaybe<Scalars['Int']['input']>;
|
58
|
+
gt?: InputMaybe<Scalars['Int']['input']>;
|
59
|
+
gte?: InputMaybe<Scalars['Int']['input']>;
|
60
|
+
in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
61
|
+
lt?: InputMaybe<Scalars['Int']['input']>;
|
62
|
+
lte?: InputMaybe<Scalars['Int']['input']>;
|
63
|
+
not?: InputMaybe<NestedIntWithAggregatesFilter>;
|
64
|
+
notIn?: InputMaybe<Array<Scalars['Int']['input']>>;
|
65
|
+
};
|
66
|
+
|
67
|
+
export type Mutation = {
|
68
|
+
__typename?: 'Mutation';
|
69
|
+
createManyAndReturnUser: Array<CreateManyAndReturnUser>;
|
70
|
+
createManyUser: AffectedRowsOutput;
|
71
|
+
createOneUser: User;
|
72
|
+
deleteManyUser: AffectedRowsOutput;
|
73
|
+
deleteOneUser?: Maybe<User>;
|
74
|
+
updateManyUser: AffectedRowsOutput;
|
75
|
+
updateOneUser?: Maybe<User>;
|
76
|
+
upsertOneUser: User;
|
77
|
+
};
|
78
|
+
|
79
|
+
|
80
|
+
export type MutationCreateManyAndReturnUserArgs = {
|
81
|
+
data: Array<UserCreateManyInput>;
|
82
|
+
};
|
83
|
+
|
84
|
+
|
85
|
+
export type MutationCreateManyUserArgs = {
|
86
|
+
data: Array<UserCreateManyInput>;
|
87
|
+
};
|
88
|
+
|
89
|
+
|
90
|
+
export type MutationCreateOneUserArgs = {
|
91
|
+
data?: InputMaybe<UserCreateInput>;
|
92
|
+
};
|
93
|
+
|
94
|
+
|
95
|
+
export type MutationDeleteManyUserArgs = {
|
96
|
+
where?: InputMaybe<UserWhereInput>;
|
97
|
+
};
|
98
|
+
|
99
|
+
|
100
|
+
export type MutationDeleteOneUserArgs = {
|
101
|
+
where: UserWhereUniqueInput;
|
102
|
+
};
|
103
|
+
|
104
|
+
|
105
|
+
export type MutationUpdateManyUserArgs = {
|
106
|
+
data: UserUpdateManyMutationInput;
|
107
|
+
where?: InputMaybe<UserWhereInput>;
|
108
|
+
};
|
109
|
+
|
110
|
+
|
111
|
+
export type MutationUpdateOneUserArgs = {
|
112
|
+
data: UserUpdateInput;
|
113
|
+
where: UserWhereUniqueInput;
|
114
|
+
};
|
115
|
+
|
116
|
+
|
117
|
+
export type MutationUpsertOneUserArgs = {
|
118
|
+
create: UserCreateInput;
|
119
|
+
update: UserUpdateInput;
|
120
|
+
where: UserWhereUniqueInput;
|
121
|
+
};
|
122
|
+
|
123
|
+
export type NestedFloatFilter = {
|
124
|
+
equals?: InputMaybe<Scalars['Float']['input']>;
|
125
|
+
gt?: InputMaybe<Scalars['Float']['input']>;
|
126
|
+
gte?: InputMaybe<Scalars['Float']['input']>;
|
127
|
+
in?: InputMaybe<Array<Scalars['Float']['input']>>;
|
128
|
+
lt?: InputMaybe<Scalars['Float']['input']>;
|
129
|
+
lte?: InputMaybe<Scalars['Float']['input']>;
|
130
|
+
not?: InputMaybe<NestedFloatFilter>;
|
131
|
+
notIn?: InputMaybe<Array<Scalars['Float']['input']>>;
|
132
|
+
};
|
133
|
+
|
134
|
+
export type NestedIntFilter = {
|
135
|
+
equals?: InputMaybe<Scalars['Int']['input']>;
|
136
|
+
gt?: InputMaybe<Scalars['Int']['input']>;
|
137
|
+
gte?: InputMaybe<Scalars['Int']['input']>;
|
138
|
+
in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
139
|
+
lt?: InputMaybe<Scalars['Int']['input']>;
|
140
|
+
lte?: InputMaybe<Scalars['Int']['input']>;
|
141
|
+
not?: InputMaybe<NestedIntFilter>;
|
142
|
+
notIn?: InputMaybe<Array<Scalars['Int']['input']>>;
|
143
|
+
};
|
144
|
+
|
145
|
+
export type NestedIntNullableFilter = {
|
146
|
+
equals?: InputMaybe<Scalars['Int']['input']>;
|
147
|
+
gt?: InputMaybe<Scalars['Int']['input']>;
|
148
|
+
gte?: InputMaybe<Scalars['Int']['input']>;
|
149
|
+
in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
150
|
+
lt?: InputMaybe<Scalars['Int']['input']>;
|
151
|
+
lte?: InputMaybe<Scalars['Int']['input']>;
|
152
|
+
not?: InputMaybe<NestedIntNullableFilter>;
|
153
|
+
notIn?: InputMaybe<Array<Scalars['Int']['input']>>;
|
154
|
+
};
|
155
|
+
|
156
|
+
export type NestedIntWithAggregatesFilter = {
|
157
|
+
_avg?: InputMaybe<NestedFloatFilter>;
|
158
|
+
_count?: InputMaybe<NestedIntFilter>;
|
159
|
+
_max?: InputMaybe<NestedIntFilter>;
|
160
|
+
_min?: InputMaybe<NestedIntFilter>;
|
161
|
+
_sum?: InputMaybe<NestedIntFilter>;
|
162
|
+
equals?: InputMaybe<Scalars['Int']['input']>;
|
163
|
+
gt?: InputMaybe<Scalars['Int']['input']>;
|
164
|
+
gte?: InputMaybe<Scalars['Int']['input']>;
|
165
|
+
in?: InputMaybe<Array<Scalars['Int']['input']>>;
|
166
|
+
lt?: InputMaybe<Scalars['Int']['input']>;
|
167
|
+
lte?: InputMaybe<Scalars['Int']['input']>;
|
168
|
+
not?: InputMaybe<NestedIntWithAggregatesFilter>;
|
169
|
+
notIn?: InputMaybe<Array<Scalars['Int']['input']>>;
|
170
|
+
};
|
171
|
+
|
172
|
+
export type NestedStringNullableFilter = {
|
173
|
+
contains?: InputMaybe<Scalars['String']['input']>;
|
174
|
+
endsWith?: InputMaybe<Scalars['String']['input']>;
|
175
|
+
equals?: InputMaybe<Scalars['String']['input']>;
|
176
|
+
gt?: InputMaybe<Scalars['String']['input']>;
|
177
|
+
gte?: InputMaybe<Scalars['String']['input']>;
|
178
|
+
in?: InputMaybe<Array<Scalars['String']['input']>>;
|
179
|
+
lt?: InputMaybe<Scalars['String']['input']>;
|
180
|
+
lte?: InputMaybe<Scalars['String']['input']>;
|
181
|
+
not?: InputMaybe<NestedStringNullableFilter>;
|
182
|
+
notIn?: InputMaybe<Array<Scalars['String']['input']>>;
|
183
|
+
startsWith?: InputMaybe<Scalars['String']['input']>;
|
184
|
+
};
|
185
|
+
|
186
|
+
export type NestedStringNullableWithAggregatesFilter = {
|
187
|
+
_count?: InputMaybe<NestedIntNullableFilter>;
|
188
|
+
_max?: InputMaybe<NestedStringNullableFilter>;
|
189
|
+
_min?: InputMaybe<NestedStringNullableFilter>;
|
190
|
+
contains?: InputMaybe<Scalars['String']['input']>;
|
191
|
+
endsWith?: InputMaybe<Scalars['String']['input']>;
|
192
|
+
equals?: InputMaybe<Scalars['String']['input']>;
|
193
|
+
gt?: InputMaybe<Scalars['String']['input']>;
|
194
|
+
gte?: InputMaybe<Scalars['String']['input']>;
|
195
|
+
in?: InputMaybe<Array<Scalars['String']['input']>>;
|
196
|
+
lt?: InputMaybe<Scalars['String']['input']>;
|
197
|
+
lte?: InputMaybe<Scalars['String']['input']>;
|
198
|
+
not?: InputMaybe<NestedStringNullableWithAggregatesFilter>;
|
199
|
+
notIn?: InputMaybe<Array<Scalars['String']['input']>>;
|
200
|
+
startsWith?: InputMaybe<Scalars['String']['input']>;
|
201
|
+
};
|
202
|
+
|
203
|
+
export type NullableStringFieldUpdateOperationsInput = {
|
204
|
+
set?: InputMaybe<Scalars['String']['input']>;
|
205
|
+
};
|
206
|
+
|
207
|
+
export enum NullsOrder {
|
208
|
+
FIRST = 'first',
|
209
|
+
LAST = 'last'
|
210
|
+
}
|
211
|
+
|
212
|
+
export type Query = {
|
213
|
+
__typename?: 'Query';
|
214
|
+
aggregateUser: AggregateUser;
|
215
|
+
findFirstUser?: Maybe<User>;
|
216
|
+
findFirstUserOrThrow?: Maybe<User>;
|
217
|
+
getUser?: Maybe<User>;
|
218
|
+
groupByUser: Array<UserGroupBy>;
|
219
|
+
user?: Maybe<User>;
|
220
|
+
users: Array<User>;
|
221
|
+
};
|
222
|
+
|
223
|
+
|
224
|
+
export type QueryAggregateUserArgs = {
|
225
|
+
cursor?: InputMaybe<UserWhereUniqueInput>;
|
226
|
+
orderBy?: InputMaybe<Array<UserOrderByWithRelationInput>>;
|
227
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
228
|
+
take?: InputMaybe<Scalars['Int']['input']>;
|
229
|
+
where?: InputMaybe<UserWhereInput>;
|
230
|
+
};
|
231
|
+
|
232
|
+
|
233
|
+
export type QueryFindFirstUserArgs = {
|
234
|
+
cursor?: InputMaybe<UserWhereUniqueInput>;
|
235
|
+
distinct?: InputMaybe<Array<UserScalarFieldEnum>>;
|
236
|
+
orderBy?: InputMaybe<Array<UserOrderByWithRelationInput>>;
|
237
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
238
|
+
take?: InputMaybe<Scalars['Int']['input']>;
|
239
|
+
where?: InputMaybe<UserWhereInput>;
|
240
|
+
};
|
241
|
+
|
242
|
+
|
243
|
+
export type QueryFindFirstUserOrThrowArgs = {
|
244
|
+
cursor?: InputMaybe<UserWhereUniqueInput>;
|
245
|
+
distinct?: InputMaybe<Array<UserScalarFieldEnum>>;
|
246
|
+
orderBy?: InputMaybe<Array<UserOrderByWithRelationInput>>;
|
247
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
248
|
+
take?: InputMaybe<Scalars['Int']['input']>;
|
249
|
+
where?: InputMaybe<UserWhereInput>;
|
250
|
+
};
|
251
|
+
|
252
|
+
|
253
|
+
export type QueryGetUserArgs = {
|
254
|
+
where: UserWhereUniqueInput;
|
255
|
+
};
|
256
|
+
|
257
|
+
|
258
|
+
export type QueryGroupByUserArgs = {
|
259
|
+
by: Array<UserScalarFieldEnum>;
|
260
|
+
having?: InputMaybe<UserScalarWhereWithAggregatesInput>;
|
261
|
+
orderBy?: InputMaybe<Array<UserOrderByWithAggregationInput>>;
|
262
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
263
|
+
take?: InputMaybe<Scalars['Int']['input']>;
|
264
|
+
where?: InputMaybe<UserWhereInput>;
|
265
|
+
};
|
266
|
+
|
267
|
+
|
268
|
+
export type QueryUserArgs = {
|
269
|
+
where: UserWhereUniqueInput;
|
270
|
+
};
|
271
|
+
|
272
|
+
|
273
|
+
export type QueryUsersArgs = {
|
274
|
+
cursor?: InputMaybe<UserWhereUniqueInput>;
|
275
|
+
distinct?: InputMaybe<Array<UserScalarFieldEnum>>;
|
276
|
+
orderBy?: InputMaybe<Array<UserOrderByWithRelationInput>>;
|
277
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
278
|
+
take?: InputMaybe<Scalars['Int']['input']>;
|
279
|
+
where?: InputMaybe<UserWhereInput>;
|
280
|
+
};
|
281
|
+
|
282
|
+
export enum SortOrder {
|
283
|
+
ASC = 'asc',
|
284
|
+
DESC = 'desc'
|
285
|
+
}
|
286
|
+
|
287
|
+
export type SortOrderInput = {
|
288
|
+
nulls?: InputMaybe<NullsOrder>;
|
289
|
+
sort: SortOrder;
|
290
|
+
};
|
291
|
+
|
292
|
+
export type StringNullableFilter = {
|
293
|
+
contains?: InputMaybe<Scalars['String']['input']>;
|
294
|
+
endsWith?: InputMaybe<Scalars['String']['input']>;
|
295
|
+
equals?: InputMaybe<Scalars['String']['input']>;
|
296
|
+
gt?: InputMaybe<Scalars['String']['input']>;
|
297
|
+
gte?: InputMaybe<Scalars['String']['input']>;
|
298
|
+
in?: InputMaybe<Array<Scalars['String']['input']>>;
|
299
|
+
lt?: InputMaybe<Scalars['String']['input']>;
|
300
|
+
lte?: InputMaybe<Scalars['String']['input']>;
|
301
|
+
not?: InputMaybe<NestedStringNullableFilter>;
|
302
|
+
notIn?: InputMaybe<Array<Scalars['String']['input']>>;
|
303
|
+
startsWith?: InputMaybe<Scalars['String']['input']>;
|
304
|
+
};
|
305
|
+
|
306
|
+
export type StringNullableWithAggregatesFilter = {
|
307
|
+
_count?: InputMaybe<NestedIntNullableFilter>;
|
308
|
+
_max?: InputMaybe<NestedStringNullableFilter>;
|
309
|
+
_min?: InputMaybe<NestedStringNullableFilter>;
|
310
|
+
contains?: InputMaybe<Scalars['String']['input']>;
|
311
|
+
endsWith?: InputMaybe<Scalars['String']['input']>;
|
312
|
+
equals?: InputMaybe<Scalars['String']['input']>;
|
313
|
+
gt?: InputMaybe<Scalars['String']['input']>;
|
314
|
+
gte?: InputMaybe<Scalars['String']['input']>;
|
315
|
+
in?: InputMaybe<Array<Scalars['String']['input']>>;
|
316
|
+
lt?: InputMaybe<Scalars['String']['input']>;
|
317
|
+
lte?: InputMaybe<Scalars['String']['input']>;
|
318
|
+
not?: InputMaybe<NestedStringNullableWithAggregatesFilter>;
|
319
|
+
notIn?: InputMaybe<Array<Scalars['String']['input']>>;
|
320
|
+
startsWith?: InputMaybe<Scalars['String']['input']>;
|
321
|
+
};
|
322
|
+
|
323
|
+
export type User = {
|
324
|
+
__typename?: 'User';
|
325
|
+
id: Scalars['Int']['output'];
|
326
|
+
name?: Maybe<Scalars['String']['output']>;
|
327
|
+
};
|
328
|
+
|
329
|
+
export type UserAvgAggregate = {
|
330
|
+
__typename?: 'UserAvgAggregate';
|
331
|
+
id?: Maybe<Scalars['Float']['output']>;
|
332
|
+
};
|
333
|
+
|
334
|
+
export type UserAvgOrderByAggregateInput = {
|
335
|
+
id?: InputMaybe<SortOrder>;
|
336
|
+
};
|
337
|
+
|
338
|
+
export type UserCountAggregate = {
|
339
|
+
__typename?: 'UserCountAggregate';
|
340
|
+
_all: Scalars['Int']['output'];
|
341
|
+
id: Scalars['Int']['output'];
|
342
|
+
name: Scalars['Int']['output'];
|
343
|
+
};
|
344
|
+
|
345
|
+
export type UserCountOrderByAggregateInput = {
|
346
|
+
id?: InputMaybe<SortOrder>;
|
347
|
+
name?: InputMaybe<SortOrder>;
|
348
|
+
};
|
349
|
+
|
350
|
+
export type UserCreateInput = {
|
351
|
+
name?: InputMaybe<Scalars['String']['input']>;
|
352
|
+
};
|
353
|
+
|
354
|
+
export type UserCreateManyInput = {
|
355
|
+
id?: InputMaybe<Scalars['Int']['input']>;
|
356
|
+
name?: InputMaybe<Scalars['String']['input']>;
|
357
|
+
};
|
358
|
+
|
359
|
+
export type UserGroupBy = {
|
360
|
+
__typename?: 'UserGroupBy';
|
361
|
+
_avg?: Maybe<UserAvgAggregate>;
|
362
|
+
_count?: Maybe<UserCountAggregate>;
|
363
|
+
_max?: Maybe<UserMaxAggregate>;
|
364
|
+
_min?: Maybe<UserMinAggregate>;
|
365
|
+
_sum?: Maybe<UserSumAggregate>;
|
366
|
+
id: Scalars['Int']['output'];
|
367
|
+
name?: Maybe<Scalars['String']['output']>;
|
368
|
+
};
|
369
|
+
|
370
|
+
export type UserMaxAggregate = {
|
371
|
+
__typename?: 'UserMaxAggregate';
|
372
|
+
id?: Maybe<Scalars['Int']['output']>;
|
373
|
+
name?: Maybe<Scalars['String']['output']>;
|
374
|
+
};
|
375
|
+
|
376
|
+
export type UserMaxOrderByAggregateInput = {
|
377
|
+
id?: InputMaybe<SortOrder>;
|
378
|
+
name?: InputMaybe<SortOrder>;
|
379
|
+
};
|
380
|
+
|
381
|
+
export type UserMinAggregate = {
|
382
|
+
__typename?: 'UserMinAggregate';
|
383
|
+
id?: Maybe<Scalars['Int']['output']>;
|
384
|
+
name?: Maybe<Scalars['String']['output']>;
|
385
|
+
};
|
386
|
+
|
387
|
+
export type UserMinOrderByAggregateInput = {
|
388
|
+
id?: InputMaybe<SortOrder>;
|
389
|
+
name?: InputMaybe<SortOrder>;
|
390
|
+
};
|
391
|
+
|
392
|
+
export type UserOrderByWithAggregationInput = {
|
393
|
+
_avg?: InputMaybe<UserAvgOrderByAggregateInput>;
|
394
|
+
_count?: InputMaybe<UserCountOrderByAggregateInput>;
|
395
|
+
_max?: InputMaybe<UserMaxOrderByAggregateInput>;
|
396
|
+
_min?: InputMaybe<UserMinOrderByAggregateInput>;
|
397
|
+
_sum?: InputMaybe<UserSumOrderByAggregateInput>;
|
398
|
+
id?: InputMaybe<SortOrder>;
|
399
|
+
name?: InputMaybe<SortOrderInput>;
|
400
|
+
};
|
401
|
+
|
402
|
+
export type UserOrderByWithRelationInput = {
|
403
|
+
id?: InputMaybe<SortOrder>;
|
404
|
+
name?: InputMaybe<SortOrderInput>;
|
405
|
+
};
|
406
|
+
|
407
|
+
export enum UserScalarFieldEnum {
|
408
|
+
ID = 'id',
|
409
|
+
NAME = 'name'
|
410
|
+
}
|
411
|
+
|
412
|
+
export type UserScalarWhereWithAggregatesInput = {
|
413
|
+
AND?: InputMaybe<Array<UserScalarWhereWithAggregatesInput>>;
|
414
|
+
NOT?: InputMaybe<Array<UserScalarWhereWithAggregatesInput>>;
|
415
|
+
OR?: InputMaybe<Array<UserScalarWhereWithAggregatesInput>>;
|
416
|
+
id?: InputMaybe<IntWithAggregatesFilter>;
|
417
|
+
name?: InputMaybe<StringNullableWithAggregatesFilter>;
|
418
|
+
};
|
419
|
+
|
420
|
+
export type UserSumAggregate = {
|
421
|
+
__typename?: 'UserSumAggregate';
|
422
|
+
id?: Maybe<Scalars['Int']['output']>;
|
423
|
+
};
|
424
|
+
|
425
|
+
export type UserSumOrderByAggregateInput = {
|
426
|
+
id?: InputMaybe<SortOrder>;
|
427
|
+
};
|
428
|
+
|
429
|
+
export type UserUpdateInput = {
|
430
|
+
name?: InputMaybe<NullableStringFieldUpdateOperationsInput>;
|
431
|
+
};
|
432
|
+
|
433
|
+
export type UserUpdateManyMutationInput = {
|
434
|
+
name?: InputMaybe<NullableStringFieldUpdateOperationsInput>;
|
435
|
+
};
|
436
|
+
|
437
|
+
export type UserWhereInput = {
|
438
|
+
AND?: InputMaybe<Array<UserWhereInput>>;
|
439
|
+
NOT?: InputMaybe<Array<UserWhereInput>>;
|
440
|
+
OR?: InputMaybe<Array<UserWhereInput>>;
|
441
|
+
id?: InputMaybe<IntFilter>;
|
442
|
+
name?: InputMaybe<StringNullableFilter>;
|
443
|
+
};
|
444
|
+
|
445
|
+
export type UserWhereUniqueInput = {
|
446
|
+
AND?: InputMaybe<Array<UserWhereInput>>;
|
447
|
+
NOT?: InputMaybe<Array<UserWhereInput>>;
|
448
|
+
OR?: InputMaybe<Array<UserWhereInput>>;
|
449
|
+
id?: InputMaybe<Scalars['Int']['input']>;
|
450
|
+
name?: InputMaybe<StringNullableFilter>;
|
451
|
+
};
|
452
|
+
|
453
|
+
export type GetUsersQueryVariables = Exact<{ [key: string]: never; }>;
|
454
|
+
|
455
|
+
|
456
|
+
export type GetUsersQuery = { __typename?: 'Query', users: Array<{ __typename?: 'User', id: number, name?: string | null }> };
|
457
|
+
|
458
|
+
|
459
|
+
export const GetUsersDocument = gql`
|
460
|
+
query GetUsers {
|
461
|
+
users {
|
462
|
+
id
|
463
|
+
name
|
464
|
+
}
|
465
|
+
}
|
466
|
+
`;
|
467
|
+
|
468
|
+
/**
|
469
|
+
* __useGetUsersQuery__
|
470
|
+
*
|
471
|
+
* To run a query within a React component, call `useGetUsersQuery` and pass it any options that fit your needs.
|
472
|
+
* When your component renders, `useGetUsersQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
473
|
+
* you can use to render your UI.
|
474
|
+
*
|
475
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
476
|
+
*
|
477
|
+
* @example
|
478
|
+
* const { data, loading, error } = useGetUsersQuery({
|
479
|
+
* variables: {
|
480
|
+
* },
|
481
|
+
* });
|
482
|
+
*/
|
483
|
+
export function useGetUsersQuery(baseOptions?: Apollo.QueryHookOptions<GetUsersQuery, GetUsersQueryVariables>) {
|
484
|
+
const options = {...defaultOptions, ...baseOptions}
|
485
|
+
return Apollo.useQuery<GetUsersQuery, GetUsersQueryVariables>(GetUsersDocument, options);
|
486
|
+
}
|
487
|
+
export function useGetUsersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetUsersQuery, GetUsersQueryVariables>) {
|
488
|
+
const options = {...defaultOptions, ...baseOptions}
|
489
|
+
return Apollo.useLazyQuery<GetUsersQuery, GetUsersQueryVariables>(GetUsersDocument, options);
|
490
|
+
}
|
491
|
+
export function useGetUsersSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions<GetUsersQuery, GetUsersQueryVariables>) {
|
492
|
+
const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions}
|
493
|
+
return Apollo.useSuspenseQuery<GetUsersQuery, GetUsersQueryVariables>(GetUsersDocument, options);
|
494
|
+
}
|
495
|
+
export type GetUsersQueryHookResult = ReturnType<typeof useGetUsersQuery>;
|
496
|
+
export type GetUsersLazyQueryHookResult = ReturnType<typeof useGetUsersLazyQuery>;
|
497
|
+
export type GetUsersSuspenseQueryHookResult = ReturnType<typeof useGetUsersSuspenseQuery>;
|
498
|
+
export type GetUsersQueryResult = Apollo.QueryResult<GetUsersQuery, GetUsersQueryVariables>;
|
package/src/index.ts
ADDED
package/src/user/hook.ts
ADDED
package/tsconfig.json
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES6", // Target ECMAScript version
|
4
|
+
"module": "ESNext", // Módulo ES6
|
5
|
+
"moduleResolution": "Node", // Resolución de módulos
|
6
|
+
"jsx": "react-jsx", // Habilita JSX en archivos .tsx (requerido para React 17+)
|
7
|
+
"outDir": "./dist", // Carpeta de salida de los archivos compilados
|
8
|
+
"rootDir": "./src", // Carpeta de origen de los archivos fuente
|
9
|
+
"strict": true, // Opciones estrictas de TypeScript
|
10
|
+
"esModuleInterop": true, // Habilita interoperabilidad con ESModules
|
11
|
+
"skipLibCheck": true, // Omite la verificación de tipos de las dependencias
|
12
|
+
"forceConsistentCasingInFileNames": true
|
13
|
+
},
|
14
|
+
"include": [
|
15
|
+
"src/**/*" // Incluir todos los archivos en la carpeta src
|
16
|
+
],
|
17
|
+
"exclude": [
|
18
|
+
"node_modules" // Excluir la carpeta node_modules
|
19
|
+
]
|
20
|
+
}
|