@devticon-os/graphql-codegen-axios 0.2.16 → 0.2.18

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.16",
3
+ "version": "0.2.18",
4
4
  "license": "MIT",
5
5
  "main": "src/index.js",
6
6
  "repository": "https://github.com/devticon/graphql-codegen-axios",
package/src/functions.js CHANGED
@@ -4,6 +4,9 @@ const getFunctionChain = (operation, useSingleResults) => {
4
4
  const directives = selection.directives.map(d => d.name.value);
5
5
  const propertyName = selection.name.value;
6
6
  for (let directive of directives) {
7
+ if (!['first', 'firstOrFail', 'nonNullable', 'singleResult'].includes(directive)) {
8
+ continue;
9
+ }
7
10
  if (directive === 'nonNullable' || directive === 'firstOrFail') {
8
11
  chain.push(`${directive}("${propertyName}", body)`);
9
12
  } else if (directive === 'first') {
package/src/helpers.ts CHANGED
@@ -44,8 +44,7 @@ export const unpackSingleResults = (key: string) => (data: any) => data[key];
44
44
 
45
45
  export class GraphqlError extends Error {
46
46
  constructor(message: string, public gqlErrors: GraphQLError[]) {
47
- const msg = `${message} ${gqlErrors.map(e => e.message).join('\n')}`;
48
- super(msg);
47
+ super(`${message} ${gqlErrors.map(e => e.message).join('\n')}`);
49
48
  }
50
49
  }
51
50