@orion-js/graphql 2.8.3 → 2.8.4

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.
@@ -11,14 +11,18 @@ async function getOperationName(params) {
11
11
  getBodyJSON
12
12
  } = params;
13
13
 
14
- if (request.method !== 'GET') {
15
- const data = await getBodyJSON();
16
- return data.operationName;
17
- }
14
+ try {
15
+ if (request.method !== 'GET') {
16
+ const data = await getBodyJSON();
17
+ return data.operationName;
18
+ }
18
19
 
19
- if (request.method === 'GET') {
20
- // handle persisted queries
21
- const queryParams = new URLSearchParams(request.url.split('?')[1]);
22
- return queryParams.get('operationName');
20
+ if (request.method === 'GET') {
21
+ // handle persisted queries
22
+ const queryParams = new URLSearchParams(request.url.split('?')[1]);
23
+ return queryParams.get('operationName');
24
+ }
25
+ } catch (error) {
26
+ return null;
23
27
  }
24
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/graphql",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
4
4
  "main": "lib/index.js",
5
5
  "author": "nicolaslopezj",
6
6
  "license": "MIT",