@payloadcms/graphql 3.0.0-beta.33 → 3.0.0-beta.35

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.
@@ -1,5 +1,5 @@
1
1
  import { GraphQLScalarType } from 'graphql';
2
- import { Kind, print } from 'graphql/language';
2
+ import { Kind, print } from 'graphql/language/index.js';
3
3
  function identity(value) {
4
4
  return value;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/packages/graphql-type-json/index.ts"],"sourcesContent":["import { GraphQLScalarType } from 'graphql'\nimport { Kind, print } from 'graphql/language'\n\nfunction identity(value) {\n return value\n}\n\nfunction ensureObject(value) {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new TypeError(`JSONObject cannot represent non-object value: ${value}`)\n }\n\n return value\n}\n\nfunction parseObject(typeName, ast, variables) {\n const value = Object.create(null)\n ast.fields.forEach((field) => {\n // eslint-disable-next-line no-use-before-define\n value[field.name.value] = parseLiteral(typeName, field.value, variables)\n })\n\n return value\n}\n\nfunction parseLiteral(typeName, ast, variables) {\n switch (ast.kind) {\n case Kind.STRING:\n case Kind.BOOLEAN:\n return ast.value\n case Kind.INT:\n case Kind.FLOAT:\n return parseFloat(ast.value)\n case Kind.OBJECT:\n return parseObject(typeName, ast, variables)\n case Kind.LIST:\n return ast.values.map((n) => parseLiteral(typeName, n, variables))\n case Kind.NULL:\n return null\n case Kind.VARIABLE:\n return variables ? variables[ast.name.value] : undefined\n default:\n throw new TypeError(`${typeName} cannot represent value: ${print(ast)}`)\n }\n}\n\n// This named export is intended for users of CommonJS. Users of ES modules\n// should instead use the default export.\nexport const GraphQLJSON = new GraphQLScalarType({\n name: 'JSON',\n description:\n 'The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',\n parseLiteral: (ast, variables) => parseLiteral('JSON', ast, variables),\n parseValue: identity,\n serialize: identity,\n specifiedByURL: 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf',\n})\n\nexport const GraphQLJSONObject = new GraphQLScalarType({\n name: 'JSONObject',\n description:\n 'The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',\n parseLiteral: (ast, variables) => {\n if (ast.kind !== Kind.OBJECT) {\n throw new TypeError(`JSONObject cannot represent non-object value: ${print(ast)}`)\n }\n\n return parseObject('JSONObject', ast, variables)\n },\n parseValue: ensureObject,\n serialize: ensureObject,\n specifiedByURL: 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf',\n})\n"],"names":["GraphQLScalarType","Kind","print","identity","value","ensureObject","Array","isArray","TypeError","parseObject","typeName","ast","variables","Object","create","fields","forEach","field","name","parseLiteral","kind","STRING","BOOLEAN","INT","FLOAT","parseFloat","OBJECT","LIST","values","map","n","NULL","VARIABLE","undefined","GraphQLJSON","description","parseValue","serialize","specifiedByURL","GraphQLJSONObject"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,iBAAiB,QAAQ,UAAS;AAC3C,SAASC,IAAI,EAAEC,KAAK,QAAQ,mBAAkB;AAE9C,SAASC,SAASC,KAAK;IACrB,OAAOA;AACT;AAEA,SAASC,aAAaD,KAAK;IACzB,IAAI,OAAOA,UAAU,YAAYA,UAAU,QAAQE,MAAMC,OAAO,CAACH,QAAQ;QACvE,MAAM,IAAII,UAAU,CAAC,8CAA8C,EAAEJ,MAAM,CAAC;IAC9E;IAEA,OAAOA;AACT;AAEA,SAASK,YAAYC,QAAQ,EAAEC,GAAG,EAAEC,SAAS;IAC3C,MAAMR,QAAQS,OAAOC,MAAM,CAAC;IAC5BH,IAAII,MAAM,CAACC,OAAO,CAAC,CAACC;QAClB,gDAAgD;QAChDb,KAAK,CAACa,MAAMC,IAAI,CAACd,KAAK,CAAC,GAAGe,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AAWhC;IACXiC,gBAAgB;AAClB,GAAE"}
1
+ {"version":3,"sources":["../../../src/packages/graphql-type-json/index.ts"],"sourcesContent":["import { GraphQLScalarType } from 'graphql'\nimport { Kind, print } from 'graphql/language/index.js'\n\nfunction identity(value) {\n return value\n}\n\nfunction ensureObject(value) {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new TypeError(`JSONObject cannot represent non-object value: ${value}`)\n }\n\n return value\n}\n\nfunction parseObject(typeName, ast, variables) {\n const value = Object.create(null)\n ast.fields.forEach((field) => {\n // eslint-disable-next-line no-use-before-define\n value[field.name.value] = parseLiteral(typeName, field.value, variables)\n })\n\n return value\n}\n\nfunction parseLiteral(typeName, ast, variables) {\n switch (ast.kind) {\n case Kind.STRING:\n case Kind.BOOLEAN:\n return ast.value\n case Kind.INT:\n case Kind.FLOAT:\n return parseFloat(ast.value)\n case Kind.OBJECT:\n return parseObject(typeName, ast, variables)\n case Kind.LIST:\n return ast.values.map((n) => parseLiteral(typeName, n, variables))\n case Kind.NULL:\n return null\n case Kind.VARIABLE:\n return variables ? variables[ast.name.value] : undefined\n default:\n throw new TypeError(`${typeName} cannot represent value: ${print(ast)}`)\n }\n}\n\n// This named export is intended for users of CommonJS. Users of ES modules\n// should instead use the default export.\nexport const GraphQLJSON = new GraphQLScalarType({\n name: 'JSON',\n description:\n 'The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',\n parseLiteral: (ast, variables) => parseLiteral('JSON', ast, variables),\n parseValue: identity,\n serialize: identity,\n specifiedByURL: 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf',\n})\n\nexport const GraphQLJSONObject = new GraphQLScalarType({\n name: 'JSONObject',\n description:\n 'The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',\n parseLiteral: (ast, variables) => {\n if (ast.kind !== Kind.OBJECT) {\n throw new TypeError(`JSONObject cannot represent non-object value: ${print(ast)}`)\n }\n\n return parseObject('JSONObject', ast, variables)\n },\n parseValue: ensureObject,\n serialize: ensureObject,\n specifiedByURL: 'http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf',\n})\n"],"names":["GraphQLScalarType","Kind","print","identity","value","ensureObject","Array","isArray","TypeError","parseObject","typeName","ast","variables","Object","create","fields","forEach","field","name","parseLiteral","kind","STRING","BOOLEAN","INT","FLOAT","parseFloat","OBJECT","LIST","values","map","n","NULL","VARIABLE","undefined","GraphQLJSON","description","parseValue","serialize","specifiedByURL","GraphQLJSONObject"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,iBAAiB,QAAQ,UAAS;AAC3C,SAASC,IAAI,EAAEC,KAAK,QAAQ,4BAA2B;AAEvD,SAASC,SAASC,KAAK;IACrB,OAAOA;AACT;AAEA,SAASC,aAAaD,KAAK;IACzB,IAAI,OAAOA,UAAU,YAAYA,UAAU,QAAQE,MAAMC,OAAO,CAACH,QAAQ;QACvE,MAAM,IAAII,UAAU,CAAC,8CAA8C,EAAEJ,MAAM,CAAC;IAC9E;IAEA,OAAOA;AACT;AAEA,SAASK,YAAYC,QAAQ,EAAEC,GAAG,EAAEC,SAAS;IAC3C,MAAMR,QAAQS,OAAOC,MAAM,CAAC;IAC5BH,IAAII,MAAM,CAACC,OAAO,CAAC,CAACC;QAClB,gDAAgD;QAChDb,KAAK,CAACa,MAAMC,IAAI,CAACd,KAAK,CAAC,GAAGe,aAAaT,UAAUO,MAAMb,KAAK,EAAEQ;IAChE;IAEA,OAAOR;AACT;AAEA,SAASe,aAAaT,QAAQ,EAAEC,GAAG,EAAEC,SAAS;IAC5C,OAAQD,IAAIS,IAAI;QACd,KAAKnB,KAAKoB,MAAM;QAChB,KAAKpB,KAAKqB,OAAO;YACf,OAAOX,IAAIP,KAAK;QAClB,KAAKH,KAAKsB,GAAG;QACb,KAAKtB,KAAKuB,KAAK;YACb,OAAOC,WAAWd,IAAIP,KAAK;QAC7B,KAAKH,KAAKyB,MAAM;YACd,OAAOjB,YAAYC,UAAUC,KAAKC;QACpC,KAAKX,KAAK0B,IAAI;YACZ,OAAOhB,IAAIiB,MAAM,CAACC,GAAG,CAAC,CAACC,IAAMX,aAAaT,UAAUoB,GAAGlB;QACzD,KAAKX,KAAK8B,IAAI;YACZ,OAAO;QACT,KAAK9B,KAAK+B,QAAQ;YAChB,OAAOpB,YAAYA,SAAS,CAACD,IAAIO,IAAI,CAACd,KAAK,CAAC,GAAG6B;QACjD;YACE,MAAM,IAAIzB,UAAU,CAAC,EAAEE,SAAS,yBAAyB,EAAER,MAAMS,KAAK,CAAC;IAC3E;AACF;AAEA,2EAA2E;AAC3E,0CAA0C;AAC1C,OAAO,MAAMuB,cAAc,IAAIlC,kBAAkB;IAC/CkB,MAAM;IACNiB,aACE;IACFhB,cAAc,CAACR,KAAKC,YAAcO,aAAa,QAAQR,KAAKC;IAC5DwB,YAAYjC;IACZkC,WAAWlC;IACXmC,gBAAgB;AAClB,GAAE;AAEF,OAAO,MAAMC,oBAAoB,IAAIvC,kBAAkB;IACrDkB,MAAM;IACNiB,aACE;IACFhB,cAAc,CAACR,KAAKC;QAClB,IAAID,IAAIS,IAAI,KAAKnB,KAAKyB,MAAM,EAAE;YAC5B,MAAM,IAAIlB,UAAU,CAAC,8CAA8C,EAAEN,MAAMS,KAAK,CAAC;QACnF;QAEA,OAAOF,YAAY,cAAcE,KAAKC;IACxC;IACAwB,YAAY/B;IACZgC,WAAWhC;IACXiC,gBAAgB;AAClB,GAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/graphql",
3
- "version": "3.0.0-beta.33",
3
+ "version": "3.0.0-beta.35",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,11 +37,11 @@
37
37
  "@types/pluralize": "^0.0.33",
38
38
  "graphql-http": "^1.22.0",
39
39
  "@payloadcms/eslint-config": "1.1.1",
40
- "payload": "3.0.0-beta.33"
40
+ "payload": "3.0.0-beta.35"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "graphql": "^16.8.1",
44
- "payload": "3.0.0-beta.33"
44
+ "payload": "3.0.0-beta.35"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "pnpm build:swc && pnpm build:types",