@devticon-os/graphql-codegen-axios 0.2.8 → 0.2.9
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/package.json +1 -1
- package/src/index.js +1 -1
- package/src/render.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/render.js
CHANGED
|
@@ -3,7 +3,7 @@ const { getUsedFragments } = require('./query');
|
|
|
3
3
|
const { GraphQLInputObjectType } = require('graphql/type');
|
|
4
4
|
|
|
5
5
|
const getName = (name, type, config) => {
|
|
6
|
-
const suffix = config.suffix ? config.suffix[type] : '';
|
|
6
|
+
const suffix = config.suffix ? config.suffix[type] || '' : '';
|
|
7
7
|
return `${name}${suffix}`;
|
|
8
8
|
};
|
|
9
9
|
const renderType = ({ name, fields, union, isList, isNullable, gqlType }, config) => {
|
|
@@ -92,13 +92,13 @@ const renderEnum = (e, config) => {
|
|
|
92
92
|
const renderFragment = fragment => {
|
|
93
93
|
return `export const ${fragment.name}FragmentQuery = \`${print(fragment.type)}\`;`;
|
|
94
94
|
};
|
|
95
|
-
const renderScalars = (scalars,
|
|
96
|
-
map = {
|
|
95
|
+
const renderScalars = (scalars, config = {}) => {
|
|
96
|
+
const map = {
|
|
97
97
|
String: 'string',
|
|
98
98
|
Boolean: 'boolean',
|
|
99
99
|
Int: 'number',
|
|
100
100
|
Float: 'number',
|
|
101
|
-
...
|
|
101
|
+
...(config.scalars || {}),
|
|
102
102
|
};
|
|
103
103
|
return `export type Scalar = {${scalars
|
|
104
104
|
.map(({ name }) => {
|