@devticon-os/graphql-codegen-axios 0.5.4 → 0.5.6

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.5.4",
3
+ "version": "0.5.6",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "repository": "https://github.com/devticon/graphql-codegen-axios",
@@ -117,7 +117,8 @@ const execute = (
117
117
  client.post('', body, config).then(({ data }: AxiosResponse<GraphqlResponse<any>>) => {
118
118
  const errors = data.errors;
119
119
  if (errors && errors.length > 0) {
120
- throw new GraphqlError('Request failed', errors);
120
+ const queryName = body.query.replace(/\s+/g, ' ').split(/[({]/g)[0];
121
+ throw new GraphqlError(`GraphQL '${queryName}' failed`, errors);
121
122
  }
122
123
  let d = data.data;
123
124
  for (let func of functions) {