@constructive-io/graphql-react 3.1.0 → 4.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.
@@ -8,11 +8,9 @@ const fieldFragment = `
8
8
  type {
9
9
  gqlType
10
10
  isArray
11
- modifier
12
- pgAlias
13
11
  pgType
14
- subtype
15
- typmod
12
+ isNotNull
13
+ hasDefault
16
14
  }
17
15
  `;
18
16
  const queryFragment = `
@@ -32,12 +30,14 @@ const primaryConstraintsFragment = `
32
30
  }
33
31
  }
34
32
  `;
35
- const foreignKeyConstraintsFragments = `
33
+ const foreignKeyConstraintsFragment = `
36
34
  foreignKeyConstraints {
37
35
  name
38
36
  fields {
39
37
  ${fieldFragment}
40
38
  }
39
+ referencedTable
40
+ referencedFields
41
41
  refFields {
42
42
  ${fieldFragment}
43
43
  }
@@ -48,28 +48,18 @@ const foreignKeyConstraintsFragments = `
48
48
  `;
49
49
  const inflectionFragment = `
50
50
  inflection {
51
+ tableType
51
52
  allRows
52
- allRowsSimple
53
- conditionType
54
53
  connection
55
- createField
56
- createInputType
57
- createPayloadType
58
- deleteByPrimaryKey
59
- deletePayloadType
60
54
  edge
61
- edgeField
62
- enumType
63
55
  filterType
64
- inputType
65
56
  orderByType
66
- patchField
57
+ conditionType
67
58
  patchType
68
- tableFieldName
69
- tableType
70
- typeName
71
- updateByPrimaryKey
59
+ createInputType
60
+ createPayloadType
72
61
  updatePayloadType
62
+ deletePayloadType
73
63
  }
74
64
  `;
75
65
  const metaQuery = gql `
@@ -87,7 +77,7 @@ const metaQuery = gql `
87
77
 
88
78
  ${primaryConstraintsFragment}
89
79
 
90
- ${foreignKeyConstraintsFragments}
80
+ ${foreignKeyConstraintsFragment}
91
81
 
92
82
  uniqueConstraints {
93
83
  name
@@ -106,9 +96,6 @@ const metaQuery = gql `
106
96
  }
107
97
  references {
108
98
  name
109
- fields {
110
- ${fieldFragment}
111
- }
112
99
  }
113
100
  }
114
101
  has {
@@ -120,11 +107,6 @@ const metaQuery = gql `
120
107
  }
121
108
  referencedBy {
122
109
  name
123
- fields {
124
- ${fieldFragment}
125
- }
126
- ${primaryConstraintsFragment}
127
- ${foreignKeyConstraintsFragments}
128
110
  }
129
111
  }
130
112
  hasMany {
@@ -136,11 +118,6 @@ const metaQuery = gql `
136
118
  }
137
119
  referencedBy {
138
120
  name
139
- fields {
140
- ${fieldFragment}
141
- }
142
- ${primaryConstraintsFragment}
143
- ${foreignKeyConstraintsFragments}
144
121
  }
145
122
  }
146
123
  hasOne {
@@ -152,11 +129,6 @@ const metaQuery = gql `
152
129
  }
153
130
  referencedBy {
154
131
  name
155
- fields {
156
- ${fieldFragment}
157
- }
158
- ${primaryConstraintsFragment}
159
- ${foreignKeyConstraintsFragments}
160
132
  }
161
133
  }
162
134
  manyToMany {
@@ -170,21 +142,39 @@ const metaQuery = gql `
170
142
  }
171
143
  junctionTable {
172
144
  name
145
+ }
146
+ junctionLeftConstraint {
147
+ name
173
148
  fields {
174
149
  ${fieldFragment}
175
150
  }
176
- ${queryFragment}
177
- ${primaryConstraintsFragment}
178
- ${foreignKeyConstraintsFragments}
151
+ refFields {
152
+ ${fieldFragment}
153
+ }
154
+ refTable {
155
+ name
156
+ }
179
157
  }
180
- rightTable {
158
+ junctionRightConstraint {
181
159
  name
182
160
  fields {
183
161
  ${fieldFragment}
184
162
  }
185
- ${queryFragment}
186
- ${primaryConstraintsFragment}
187
- ${foreignKeyConstraintsFragments}
163
+ refFields {
164
+ ${fieldFragment}
165
+ }
166
+ refTable {
167
+ name
168
+ }
169
+ }
170
+ junctionLeftKeyAttributes {
171
+ ${fieldFragment}
172
+ }
173
+ junctionRightKeyAttributes {
174
+ ${fieldFragment}
175
+ }
176
+ rightTable {
177
+ name
188
178
  }
189
179
  }
190
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-react",
3
- "version": "3.1.0",
3
+ "version": "4.0.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "Constructive GraphQL React",
6
6
  "main": "index.js",
@@ -23,13 +23,14 @@
23
23
  "clean": "makage clean",
24
24
  "prepack": "npm run build",
25
25
  "build": "makage build",
26
+ "build:dev": "makage build --dev",
26
27
  "test": "jest --passWithNoTests",
27
28
  "test:watch": "jest --watch"
28
29
  },
29
30
  "dependencies": {
30
- "@constructive-io/graphql-query": "^2.8.0",
31
+ "@constructive-io/graphql-query": "^3.0.0",
31
32
  "graphql-request": "^7.1.2",
32
- "introspectron": "^3.1.0",
33
+ "introspectron": "^4.0.0",
33
34
  "react": "^19.2.3",
34
35
  "react-dom": "^19.2.3",
35
36
  "react-query": "^3.39.3"
@@ -38,7 +39,7 @@
38
39
  "@testing-library/jest-dom": "5.11.10",
39
40
  "@testing-library/react": "11.2.5",
40
41
  "@types/react": "^19.2.8",
41
- "makage": "^0.1.12"
42
+ "makage": "^0.1.10"
42
43
  },
43
- "gitHead": "048188f6b43ffaa6146e7694b2b0d35d34cb2945"
44
+ "gitHead": "b2daeefe49cdefb3d01ea63cf778fb9b847ab5fe"
44
45
  }
@@ -11,11 +11,9 @@ const fieldFragment = `
11
11
  type {
12
12
  gqlType
13
13
  isArray
14
- modifier
15
- pgAlias
16
14
  pgType
17
- subtype
18
- typmod
15
+ isNotNull
16
+ hasDefault
19
17
  }
20
18
  `;
21
19
  const queryFragment = `
@@ -35,12 +33,14 @@ const primaryConstraintsFragment = `
35
33
  }
36
34
  }
37
35
  `;
38
- const foreignKeyConstraintsFragments = `
36
+ const foreignKeyConstraintsFragment = `
39
37
  foreignKeyConstraints {
40
38
  name
41
39
  fields {
42
40
  ${fieldFragment}
43
41
  }
42
+ referencedTable
43
+ referencedFields
44
44
  refFields {
45
45
  ${fieldFragment}
46
46
  }
@@ -51,28 +51,18 @@ const foreignKeyConstraintsFragments = `
51
51
  `;
52
52
  const inflectionFragment = `
53
53
  inflection {
54
+ tableType
54
55
  allRows
55
- allRowsSimple
56
- conditionType
57
56
  connection
58
- createField
59
- createInputType
60
- createPayloadType
61
- deleteByPrimaryKey
62
- deletePayloadType
63
57
  edge
64
- edgeField
65
- enumType
66
58
  filterType
67
- inputType
68
59
  orderByType
69
- patchField
60
+ conditionType
70
61
  patchType
71
- tableFieldName
72
- tableType
73
- typeName
74
- updateByPrimaryKey
62
+ createInputType
63
+ createPayloadType
75
64
  updatePayloadType
65
+ deletePayloadType
76
66
  }
77
67
  `;
78
68
  const metaQuery = (0, graphql_request_1.gql) `
@@ -90,7 +80,7 @@ const metaQuery = (0, graphql_request_1.gql) `
90
80
 
91
81
  ${primaryConstraintsFragment}
92
82
 
93
- ${foreignKeyConstraintsFragments}
83
+ ${foreignKeyConstraintsFragment}
94
84
 
95
85
  uniqueConstraints {
96
86
  name
@@ -109,9 +99,6 @@ const metaQuery = (0, graphql_request_1.gql) `
109
99
  }
110
100
  references {
111
101
  name
112
- fields {
113
- ${fieldFragment}
114
- }
115
102
  }
116
103
  }
117
104
  has {
@@ -123,11 +110,6 @@ const metaQuery = (0, graphql_request_1.gql) `
123
110
  }
124
111
  referencedBy {
125
112
  name
126
- fields {
127
- ${fieldFragment}
128
- }
129
- ${primaryConstraintsFragment}
130
- ${foreignKeyConstraintsFragments}
131
113
  }
132
114
  }
133
115
  hasMany {
@@ -139,11 +121,6 @@ const metaQuery = (0, graphql_request_1.gql) `
139
121
  }
140
122
  referencedBy {
141
123
  name
142
- fields {
143
- ${fieldFragment}
144
- }
145
- ${primaryConstraintsFragment}
146
- ${foreignKeyConstraintsFragments}
147
124
  }
148
125
  }
149
126
  hasOne {
@@ -155,11 +132,6 @@ const metaQuery = (0, graphql_request_1.gql) `
155
132
  }
156
133
  referencedBy {
157
134
  name
158
- fields {
159
- ${fieldFragment}
160
- }
161
- ${primaryConstraintsFragment}
162
- ${foreignKeyConstraintsFragments}
163
135
  }
164
136
  }
165
137
  manyToMany {
@@ -173,21 +145,39 @@ const metaQuery = (0, graphql_request_1.gql) `
173
145
  }
174
146
  junctionTable {
175
147
  name
148
+ }
149
+ junctionLeftConstraint {
150
+ name
176
151
  fields {
177
152
  ${fieldFragment}
178
153
  }
179
- ${queryFragment}
180
- ${primaryConstraintsFragment}
181
- ${foreignKeyConstraintsFragments}
154
+ refFields {
155
+ ${fieldFragment}
156
+ }
157
+ refTable {
158
+ name
159
+ }
182
160
  }
183
- rightTable {
161
+ junctionRightConstraint {
184
162
  name
185
163
  fields {
186
164
  ${fieldFragment}
187
165
  }
188
- ${queryFragment}
189
- ${primaryConstraintsFragment}
190
- ${foreignKeyConstraintsFragments}
166
+ refFields {
167
+ ${fieldFragment}
168
+ }
169
+ refTable {
170
+ name
171
+ }
172
+ }
173
+ junctionLeftKeyAttributes {
174
+ ${fieldFragment}
175
+ }
176
+ junctionRightKeyAttributes {
177
+ ${fieldFragment}
178
+ }
179
+ rightTable {
180
+ name
191
181
  }
192
182
  }
193
183
  }