@jsb188/graphql 1.0.2 → 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/cache/config.ts +4 -1
- package/cache/index.ts +25 -33
- package/client/index.ts +2 -0
- package/client/request.ts +195 -0
- package/gql/fragments/accountAuthFragments.ts +16 -0
- package/gql/fragments/accountFragments.ts +10 -0
- package/gql/fragments/aiChatFragments.ts +5 -1
- package/gql/fragments/journalFragments.ts +14 -0
- package/gql/fragments/organizationFragments.ts +24 -0
- package/gql/fragments/{authFragments.ts → userAuthFragments.ts} +1 -1
- package/gql/mutations/accountAuthMutations.ts +53 -0
- package/gql/mutations/aiChatMutations.ts +40 -2
- package/gql/mutations/journalMutations.ts +2 -0
- package/gql/mutations/{authMutations.ts → userAuthMutations.ts} +3 -3
- package/gql/queries/aiChatQueries.ts +42 -6
- package/gql/queries/journalQueries.ts +22 -0
- package/gql/queries/organizationQueries.ts +52 -0
- package/hooks/index.ts +791 -0
- package/hooks/use-aiChat-qry.ts +160 -0
- package/hooks/use-app-qry.ts +19 -0
- package/hooks/use-auth-mtn.ts +234 -0
- package/hooks/use-journal-qry.ts +49 -0
- package/hooks/use-organization-qry.ts +37 -0
- package/package.json +29 -10
- package/sse.ts +132 -0
- package/types.d.ts +24 -7
- package/{cache/utils.ts → utils.ts} +32 -1
- package/main.ts +0 -2
- /package/gql/queries/{authQueries.ts → appQueries.ts} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { gql } from 'graphql-tag';
|
|
2
|
+
import { journalEntryFragment } from '../fragments/journalFragments';
|
|
3
|
+
|
|
4
|
+
export const journalEntriesQry = gql`
|
|
5
|
+
query journalEntries (
|
|
6
|
+
$organizationId: GenericID!
|
|
7
|
+
$cursor: Cursor
|
|
8
|
+
$after: Boolean!
|
|
9
|
+
$limit: Int!
|
|
10
|
+
) {
|
|
11
|
+
journalEntries (
|
|
12
|
+
organizationId: $organizationId
|
|
13
|
+
cursor: $cursor
|
|
14
|
+
after: $after
|
|
15
|
+
limit: $limit
|
|
16
|
+
) {
|
|
17
|
+
...journalEntryFragment
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
${journalEntryFragment}
|
|
22
|
+
`;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { gql } from 'graphql-tag';
|
|
2
|
+
import { organizationFragment, organizationRelationshipFragment } from '../fragments/organizationFragments';
|
|
3
|
+
|
|
4
|
+
// Always use organizationRelationship() instead
|
|
5
|
+
|
|
6
|
+
// export const organizationQry = gql`
|
|
7
|
+
// query organization (
|
|
8
|
+
// $organizationId: GenericID!
|
|
9
|
+
// ) {
|
|
10
|
+
// organization (
|
|
11
|
+
// organizationId: $organizationId
|
|
12
|
+
// ) {
|
|
13
|
+
// ...organizationFragment
|
|
14
|
+
// }
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
// ${organizationFragment}
|
|
18
|
+
// `;
|
|
19
|
+
|
|
20
|
+
export const organizationRelationshipQry = gql`
|
|
21
|
+
query organizationRelationship (
|
|
22
|
+
$organizationId: GenericID!
|
|
23
|
+
) {
|
|
24
|
+
organizationRelationship (
|
|
25
|
+
organizationId: $organizationId
|
|
26
|
+
) {
|
|
27
|
+
...organizationRelationshipFragment
|
|
28
|
+
|
|
29
|
+
organization {
|
|
30
|
+
...organizationFragment
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
${organizationFragment}
|
|
36
|
+
${organizationRelationshipFragment}
|
|
37
|
+
`;
|
|
38
|
+
|
|
39
|
+
export const myOrganizationsQry = gql`
|
|
40
|
+
query myOrganizations {
|
|
41
|
+
myOrganizations {
|
|
42
|
+
...organizationRelationshipFragment
|
|
43
|
+
|
|
44
|
+
organization {
|
|
45
|
+
...organizationFragment
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
${organizationFragment}
|
|
51
|
+
${organizationRelationshipFragment}
|
|
52
|
+
`;
|