@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devticon-os/graphql-codegen-axios",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "license": "MIT",
5
5
  "main": "src/index.js",
6
6
  "repository": "https://github.com/devticon/graphql-codegen-axios",
package/src/index.js CHANGED
@@ -66,7 +66,7 @@ module.exports = {
66
66
  renderHeader('HELPERS'),
67
67
  helpers,
68
68
  renderHeader('Scalars'),
69
- renderScalars(scalars),
69
+ renderScalars(scalars, config),
70
70
  renderHeader('Enum'),
71
71
  ...enums.map(e => renderEnum(e, config)),
72
72
  renderHeader('FRAGMENTS'),
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, map = {}) => {
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
- ...map,
101
+ ...(config.scalars || {}),
102
102
  };
103
103
  return `export type Scalar = {${scalars
104
104
  .map(({ name }) => {