@vrplatform/graphql 1.0.7 → 1.1.1
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/build/main/client/headers.d.ts +3 -0
- package/build/main/client/headers.js +42 -0
- package/build/main/client/index.d.ts +13 -0
- package/build/main/client/index.js +103 -0
- package/build/main/client/subscription.d.ts +3 -0
- package/build/main/client/subscription.js +29 -0
- package/build/main/common/account.d.ts +2 -0
- package/build/main/common/account.js +7 -0
- package/build/main/common/address.d.ts +9 -0
- package/build/main/common/address.js +2 -0
- package/build/main/common/bank-record.d.ts +2 -0
- package/build/main/common/bank-record.js +7 -0
- package/build/main/common/index.d.ts +5 -0
- package/build/main/common/index.js +21 -0
- package/build/main/common/listings.d.ts +4 -0
- package/build/main/common/listings.js +99 -0
- package/build/main/common/tenant.d.ts +19 -0
- package/build/main/common/tenant.js +85 -0
- package/build/main/error.d.ts +2 -0
- package/build/main/error.js +6 -0
- package/build/main/gqty/index.d.ts +7 -0
- package/build/main/gqty/index.js +48 -0
- package/build/main/gqty/schema.generated.d.ts +39211 -46819
- package/build/main/gqty/schema.generated.js +10382 -14191
- package/build/main/index.d.ts +4 -14
- package/build/main/index.js +7 -78
- package/build/main/tsconfig.main.tsbuildinfo +1 -1
- package/build/main/types.d.ts +5 -6
- package/build/main/wrap.d.ts +12 -0
- package/build/main/wrap.js +47 -0
- package/build/module/client/headers.d.ts +3 -0
- package/build/module/client/headers.js +39 -0
- package/build/module/client/index.d.ts +13 -0
- package/build/module/client/index.js +98 -0
- package/build/module/client/subscription.d.ts +3 -0
- package/build/module/client/subscription.js +26 -0
- package/build/module/common/account.d.ts +2 -0
- package/build/module/common/account.js +4 -0
- package/build/module/common/address.d.ts +9 -0
- package/build/module/common/address.js +1 -0
- package/build/module/common/bank-record.d.ts +2 -0
- package/build/module/common/bank-record.js +4 -0
- package/build/module/common/index.d.ts +5 -0
- package/build/module/common/index.js +5 -0
- package/build/module/common/listings.d.ts +4 -0
- package/build/module/common/listings.js +93 -0
- package/build/module/common/tenant.d.ts +19 -0
- package/build/module/common/tenant.js +77 -0
- package/build/module/error.d.ts +2 -0
- package/build/module/error.js +2 -0
- package/build/module/gqty/index.d.ts +7 -0
- package/build/module/gqty/index.js +41 -0
- package/build/module/gqty/schema.generated.d.ts +39211 -46819
- package/build/module/gqty/schema.generated.js +10382 -14191
- package/build/module/index.d.ts +4 -14
- package/build/module/index.js +4 -75
- package/build/module/tsconfig.esm.tsbuildinfo +1 -1
- package/build/module/types.d.ts +5 -6
- package/build/module/wrap.d.ts +12 -0
- package/build/module/wrap.js +44 -0
- package/package.json +25 -35
- package/src/client/headers.ts +51 -0
- package/src/client/index.ts +152 -0
- package/src/client/subscription.ts +34 -0
- package/src/common/account.ts +6 -0
- package/src/common/address.ts +9 -0
- package/src/common/bank-record.ts +6 -0
- package/src/common/index.ts +5 -0
- package/src/common/listings.ts +106 -0
- package/src/common/tenant.ts +101 -0
- package/src/error.ts +1 -0
- package/src/gqty/index.ts +62 -0
- package/src/gqty/schema.generated.d.ts +39211 -46819
- package/src/gqty/schema.generated.js +10421 -14218
- package/src/index.ts +9 -97
- package/src/types.ts +6 -10
- package/src/wrap.ts +67 -0
- package/LICENSE +0 -3
- package/build/main/create-client.d.ts +0 -6
- package/build/main/create-client.js +0 -107
- package/build/main/gqty/error.d.ts +0 -6
- package/build/main/gqty/error.js +0 -48
- package/build/module/create-client.d.ts +0 -6
- package/build/module/create-client.js +0 -104
- package/build/module/gqty/error.d.ts +0 -6
- package/build/module/gqty/error.js +0 -40
- package/src/create-client.ts +0 -120
- package/src/gqty/error.ts +0 -54
|
@@ -1 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GQTY: You can safely modify this file and Query Fetcher based on your needs
|
|
3
|
+
*/
|
|
4
|
+
import { createSubscriptionsClient } from '@gqty/subscriptions';
|
|
5
|
+
import { createClient } from 'gqty';
|
|
6
|
+
import { generatedSchema, scalarsEnumsHash } from './schema.generated';
|
|
7
|
+
const queryFetcher = async (query, variables, fetchOptions) => {
|
|
8
|
+
// Modify "/api/graphql" if needed
|
|
9
|
+
const response = await fetch('/api/graphql', {
|
|
10
|
+
method: 'POST',
|
|
11
|
+
headers: {
|
|
12
|
+
'Content-Type': 'application/json',
|
|
13
|
+
},
|
|
14
|
+
body: JSON.stringify({
|
|
15
|
+
query,
|
|
16
|
+
variables,
|
|
17
|
+
}),
|
|
18
|
+
mode: 'cors',
|
|
19
|
+
...fetchOptions,
|
|
20
|
+
});
|
|
21
|
+
const json = await response.json();
|
|
22
|
+
return json;
|
|
23
|
+
};
|
|
24
|
+
const subscriptionsClient = typeof window !== 'undefined'
|
|
25
|
+
? createSubscriptionsClient({
|
|
26
|
+
wsEndpoint: () => {
|
|
27
|
+
// Modify if needed
|
|
28
|
+
const url = new URL('/api/graphql', window.location.href);
|
|
29
|
+
url.protocol = url.protocol.replace('http', 'ws');
|
|
30
|
+
return url.href;
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
: undefined;
|
|
34
|
+
export const client = createClient({
|
|
35
|
+
schema: generatedSchema,
|
|
36
|
+
scalarsEnumsHash,
|
|
37
|
+
queryFetcher,
|
|
38
|
+
subscriptionsClient,
|
|
39
|
+
});
|
|
40
|
+
const { query, mutation, mutate, subscription, resolved, refetch, track } = client;
|
|
41
|
+
export { query, mutation, mutate, subscription, resolved, refetch, track };
|
|
1
42
|
export * from './schema.generated';
|