From de95fbd4378858f788cc8ee84d1eb9f5e5111431 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Wed, 1 Nov 2023 10:30:39 +0100 Subject: [PATCH 01/26] chore: upgrade graphql and express-graphql (cherry picked from commit 34f3b527fd731ceabeb59b53a3b3610d67b62679) --- package.json | 4 +-- ...phql+14.5.4.patch => graphql+14.7.0.patch} | 9 ++++-- yarn.lock | 31 +++++++++++++------ 3 files changed, 30 insertions(+), 14 deletions(-) rename patches/{graphql+14.5.4.patch => graphql+14.7.0.patch} (83%) diff --git a/package.json b/package.json index 072ec2acd0..8bf976bcfc 100644 --- a/package.json +++ b/package.json @@ -58,12 +58,12 @@ "debug": "2.6.9", "dotenv": "10.0.0", "express": "4.17.3", - "express-graphql": "0.9.0", + "express-graphql": "^0.12.0", "express-ipfilter": "0.3.1", "express-rate-limit": "3.2.0", "form-data": "^4.0.0", "google-libphonenumber": "^3.2.25", - "graphql": "14.5.4", + "graphql": "14.7.0", "graphql-depth-limit": "1.1.0", "graphql-middleware": "1.2.6", "graphql-parse-resolve-info": "^4.12.3", diff --git a/patches/graphql+14.5.4.patch b/patches/graphql+14.7.0.patch similarity index 83% rename from patches/graphql+14.5.4.patch rename to patches/graphql+14.7.0.patch index b0aefeb8e5..3fdb9de9ca 100644 --- a/patches/graphql+14.5.4.patch +++ b/patches/graphql+14.7.0.patch @@ -1,7 +1,8 @@ -patch-package +diff --git a/node_modules/graphql/type/definition.d.ts b/node_modules/graphql/type/definition.d.ts +index 1d1b10e..35a767c 100644 --- a/node_modules/graphql/type/definition.d.ts +++ b/node_modules/graphql/type/definition.d.ts -@@ -615,15 +615,16 @@ export interface GraphQLInterfaceTypeConfig< +@@ -616,15 +616,16 @@ export interface GraphQLInterfaceTypeConfig< * }); * */ @@ -21,6 +22,8 @@ patch-package getTypes(): GraphQLObjectType[]; +diff --git a/node_modules/graphql/utilities/assertValidName.js b/node_modules/graphql/utilities/assertValidName.js +index abed985..204bdea 100644 --- a/node_modules/graphql/utilities/assertValidName.js +++ b/node_modules/graphql/utilities/assertValidName.js @@ -34,9 +34,9 @@ function assertValidName(name) { @@ -36,6 +39,8 @@ patch-package if (!NAME_RX.test(name)) { return new _GraphQLError.GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not."), node); +diff --git a/node_modules/graphql/utilities/assertValidName.mjs b/node_modules/graphql/utilities/assertValidName.mjs +index 607f9d1..033b2ed 100644 --- a/node_modules/graphql/utilities/assertValidName.mjs +++ b/node_modules/graphql/utilities/assertValidName.mjs @@ -21,9 +21,9 @@ export function assertValidName(name) { diff --git a/yarn.lock b/yarn.lock index 3d62b8b7e1..20d9e5f0b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4359,14 +4359,14 @@ expect@^24.1.0, expect@^24.9.0: jest-message-util "^24.9.0" jest-regex-util "^24.9.0" -express-graphql@0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.9.0.tgz#00fd8552f866bac5c9a4612b2c4c82076107b3c2" - integrity sha512-wccd9Lb6oeJ8yHpUs/8LcnGjFUUQYmOG9A5BNLybRdCzGw0PeUrtBxsIR8bfiur6uSW4OvPkVDoYH06z6/N9+w== +express-graphql@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/express-graphql/-/express-graphql-0.12.0.tgz#58deabc309909ca2c9fe2f83f5fbe94429aa23df" + integrity sha512-DwYaJQy0amdy3pgNtiTDuGGM2BLdj+YO2SgbKoLliCfuHv3VVTt7vNG/ZqK2hRYjtYHE2t2KB705EU94mE64zg== dependencies: accepts "^1.3.7" content-type "^1.0.4" - http-errors "^1.7.3" + http-errors "1.8.0" raw-body "^2.4.1" express-ipfilter@0.3.1: @@ -5084,10 +5084,10 @@ graphql-upload@^13.0.0: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.3.0.tgz#a91e24d10babf9e60c706919bb182b53ccdffc05" integrity sha512-xm+ANmA16BzCT5pLjuXySbQVFwH3oJctUVdy81w1sV0vBU0KgDdBGtxQOUd5zqOBk/JayAFeG8Dlmeq74rjm/A== -graphql@14.5.4: - version "14.5.4" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.5.4.tgz#b33fe957854e90c10d4c07c7d26b6c8e9f159a13" - integrity sha512-dPLvHoxy5m9FrkqWczPPRnH0X80CyvRE6e7Fa5AWEqEAzg9LpxHvKh24po/482E6VWHigOkAmb4xCp6P9yT9gw== +graphql@14.7.0: + version "14.7.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.7.0.tgz#7fa79a80a69be4a31c27dda824dc04dac2035a72" + integrity sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA== dependencies: iterall "^1.2.2" @@ -5254,7 +5254,7 @@ http-errors@1.6.2, http-errors@~1.6.2: setprototypeof "1.0.3" statuses ">= 1.3.1 < 2" -http-errors@1.7.3, http-errors@^1.7.3: +http-errors@1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== @@ -5265,6 +5265,17 @@ http-errors@1.7.3, http-errors@^1.7.3: statuses ">= 1.5.0 < 2" toidentifier "1.0.0" +http-errors@1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.0.tgz#75d1bbe497e1044f51e4ee9e704a62f28d336507" + integrity sha512-4I8r0C5JDhT5VkvI47QktDW75rNlGVsUf/8hzjCC/wkWI/jdTRmBb9aI7erSG82r1bjKY3F6k28WnsVxB1C73A== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + http-errors@1.8.1, http-errors@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" From 4778c51e45daf1cf2209fe554f3858404b8bd4ae Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Wed, 1 Nov 2023 12:14:12 +0100 Subject: [PATCH 02/26] chore: upgrade to graphql 15 (cherry picked from commit 9194bde119ad00fc1762c66e59db9ca578f7e9cc) --- package.json | 2 +- ...phql+14.7.0.patch => graphql+15.8.0.patch} | 45 +++++++++---------- scripts/dump-schema.ts | 4 +- yarn.lock | 12 +++-- 4 files changed, 28 insertions(+), 35 deletions(-) rename patches/{graphql+14.7.0.patch => graphql+15.8.0.patch} (69%) diff --git a/package.json b/package.json index 8bf976bcfc..e724d12fa4 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "express-rate-limit": "3.2.0", "form-data": "^4.0.0", "google-libphonenumber": "^3.2.25", - "graphql": "14.7.0", + "graphql": "15.8.0", "graphql-depth-limit": "1.1.0", "graphql-middleware": "1.2.6", "graphql-parse-resolve-info": "^4.12.3", diff --git a/patches/graphql+14.7.0.patch b/patches/graphql+15.8.0.patch similarity index 69% rename from patches/graphql+14.7.0.patch rename to patches/graphql+15.8.0.patch index 3fdb9de9ca..d6ec0a37a7 100644 --- a/patches/graphql+14.7.0.patch +++ b/patches/graphql+15.8.0.patch @@ -1,58 +1,53 @@ diff --git a/node_modules/graphql/type/definition.d.ts b/node_modules/graphql/type/definition.d.ts -index 1d1b10e..35a767c 100644 +index b304d22..f2d2ebe 100644 --- a/node_modules/graphql/type/definition.d.ts +++ b/node_modules/graphql/type/definition.d.ts -@@ -616,15 +616,16 @@ export interface GraphQLInterfaceTypeConfig< - * }); - * - */ --export class GraphQLUnionType { -+// TODO: Remove `any` defaults before submitting upstream. -+export class GraphQLUnionType { +@@ -708,12 +708,12 @@ export interface GraphQLUnionTypeExtensions { + export class GraphQLUnionType { name: string; description: Maybe; - resolveType: Maybe>; + resolveType: Maybe>; - extensions: Maybe>>; + extensions: Maybe>; astNode: Maybe; extensionASTNodes: Maybe>; -- constructor(config: GraphQLUnionTypeConfig); -+ constructor(config: GraphQLUnionTypeConfig); - - getTypes(): GraphQLObjectType[]; +- constructor(config: Readonly>); ++ constructor(config: Readonly>); + getTypes(): Array; + toConfig(): GraphQLUnionTypeConfig & { diff --git a/node_modules/graphql/utilities/assertValidName.js b/node_modules/graphql/utilities/assertValidName.js -index abed985..204bdea 100644 +index 5affb00..7c79a3b 100644 --- a/node_modules/graphql/utilities/assertValidName.js +++ b/node_modules/graphql/utilities/assertValidName.js @@ -34,9 +34,9 @@ function assertValidName(name) { - function isValidNameError(name, node) { - typeof name === 'string' || (0, _devAssert.default)(0, 'Expected string'); + function isValidNameError(name) { + typeof name === 'string' || (0, _devAssert.default)(0, 'Expected name to be a string.'); - if (name.length > 1 && name[0] === '_' && name[1] === '_') { -- return new _GraphQLError.GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); +- return new _GraphQLError.GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection.")); - } + // if (name.length > 1 && name[0] === '_' && name[1] === '_') { -+ // return new _GraphQLError.GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); ++ // return new _GraphQLError.GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection.")); + // } if (!NAME_RX.test(name)) { - return new _GraphQLError.GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not."), node); + return new _GraphQLError.GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not.")); diff --git a/node_modules/graphql/utilities/assertValidName.mjs b/node_modules/graphql/utilities/assertValidName.mjs -index 607f9d1..033b2ed 100644 +index d504d22..7fd641b 100644 --- a/node_modules/graphql/utilities/assertValidName.mjs +++ b/node_modules/graphql/utilities/assertValidName.mjs @@ -21,9 +21,9 @@ export function assertValidName(name) { - export function isValidNameError(name, node) { - typeof name === 'string' || devAssert(0, 'Expected string'); + export function isValidNameError(name) { + typeof name === 'string' || devAssert(0, 'Expected name to be a string.'); - if (name.length > 1 && name[0] === '_' && name[1] === '_') { -- return new GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); +- return new GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection.")); - } + // if (name.length > 1 && name[0] === '_' && name[1] === '_') { -+ // return new GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection."), node); ++ // return new GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection.")); + // } if (!NAME_RX.test(name)) { - return new GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not."), node); + return new GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not.")); diff --git a/scripts/dump-schema.ts b/scripts/dump-schema.ts index 43144f4f8a..4aef94c3cb 100644 --- a/scripts/dump-schema.ts +++ b/scripts/dump-schema.ts @@ -11,7 +11,7 @@ import { printSchema } from "graphql/utilities" import path from "path" import { schema } from "../src/schema/v2" import prettier from "prettier" -import { graphql, introspectionQuery } from "graphql" +import { getIntrospectionQuery, graphql } from "graphql" const message = "Usage: dump-schema.js /path/to/output/directory or /path/to/filename.graphql or /path/to/schema.json" @@ -30,7 +30,7 @@ const schemaPath = if (schemaPath.endsWith("json")) { console.log(`Dumping JSON to ${schemaPath}`) - graphql(schema, introspectionQuery).then( + graphql(schema, getIntrospectionQuery()).then( (result) => { const prettierResult = prettier.format(JSON.stringify(result), { parser: "json", diff --git a/yarn.lock b/yarn.lock index 20d9e5f0b9..bc69e17ea2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5084,12 +5084,10 @@ graphql-upload@^13.0.0: resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.3.0.tgz#a91e24d10babf9e60c706919bb182b53ccdffc05" integrity sha512-xm+ANmA16BzCT5pLjuXySbQVFwH3oJctUVdy81w1sV0vBU0KgDdBGtxQOUd5zqOBk/JayAFeG8Dlmeq74rjm/A== -graphql@14.7.0: - version "14.7.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.7.0.tgz#7fa79a80a69be4a31c27dda824dc04dac2035a72" - integrity sha512-l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA== - dependencies: - iterall "^1.2.2" +graphql@15.8.0: + version "15.8.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-15.8.0.tgz#33410e96b012fa3bdb1091cc99a94769db212b38" + integrity sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw== growly@^1.3.0: version "1.3.0" @@ -5847,7 +5845,7 @@ istanbul-reports@^2.2.6: dependencies: handlebars "^4.1.2" -iterall@^1.1.3, iterall@^1.2.2: +iterall@^1.1.3: version "1.2.2" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA== From 51857747a1db90934d64e784a969c91be94c9d9f Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 12:42:09 +0100 Subject: [PATCH 03/26] fix: introspection query imports --- peril/schemaValidatorUtils.ts | 8 ++++---- scripts/push-schema-changes.js | 4 ++-- src/schema/v2/filterArtworksConnection.ts | 2 +- src/schema/v2/home/context.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/peril/schemaValidatorUtils.ts b/peril/schemaValidatorUtils.ts index cbf0f1f79f..65d0888aec 100644 --- a/peril/schemaValidatorUtils.ts +++ b/peril/schemaValidatorUtils.ts @@ -1,8 +1,8 @@ import { - introspectionQuery, buildClientSchema, printSchema, buildSchema, + getIntrospectionQuery, } from "graphql" /* eslint-disable import/no-unresolved */ @@ -17,7 +17,7 @@ import fetch from "node-fetch" */ export const downloadSchemaFromURL = async (url: string) => { const postBody = { - query: introspectionQuery, + query: getIntrospectionQuery(), operationName: "IntrospectionQuery", } @@ -49,7 +49,7 @@ export const getBreakingChanges = async ( buildSchema(localSchemaSDL), buildSchema(upstreamSchemaSDL) ) - const breakings = allChanges.filter(c => c.criticality.level === "BREAKING") - const messages = breakings.map(c => c.message) + const breakings = allChanges.filter((c) => c.criticality.level === "BREAKING") + const messages = breakings.map((c) => c.message) return messages } diff --git a/scripts/push-schema-changes.js b/scripts/push-schema-changes.js index 7a884bfcf9..7283e3acb7 100644 --- a/scripts/push-schema-changes.js +++ b/scripts/push-schema-changes.js @@ -3,7 +3,7 @@ const { updateRepo } = require("@artsy/update-repo") const { execSync } = require("child_process") const path = require("path") -const { buildSchema, introspectionQuery, graphqlSync } = require("graphql") +const { buildSchema, getIntrospectionQuery, graphqlSync } = require("graphql") const { readFileSync, writeFileSync } = require("fs") const defaultBody = @@ -40,7 +40,7 @@ async function updateSchemaFile({ if (dest.endsWith(".json")) { const sdl = readFileSync("_schemaV2.graphql", "utf8").toString() const schema = buildSchema(sdl, { commentDescriptions: true }) - const gql = graphqlSync(schema, introspectionQuery) + const gql = graphqlSync(schema, getIntrospectionQuery()) writeFileSync(repoDest, JSON.stringify(gql, null, 2)) } else { execSync(`cp _schemaV2.graphql '${repoDest}'`) diff --git a/src/schema/v2/filterArtworksConnection.ts b/src/schema/v2/filterArtworksConnection.ts index 8038445129..f70c50c3a6 100644 --- a/src/schema/v2/filterArtworksConnection.ts +++ b/src/schema/v2/filterArtworksConnection.ts @@ -75,7 +75,7 @@ export const ArtworkFilterAggregations: GraphQLFieldConfig< }, } -export const ArtworkFilterFacetType = new GraphQLUnionType({ +export const ArtworkFilterFacetType = new GraphQLUnionType({ name: "ArtworkFilterFacet", types: [TagType, GeneType], resolveType: ({ context_type }) => context_type, diff --git a/src/schema/v2/home/context.ts b/src/schema/v2/home/context.ts index 71cacce062..1169bb738c 100644 --- a/src/schema/v2/home/context.ts +++ b/src/schema/v2/home/context.ts @@ -131,7 +131,7 @@ const moduleContext: HomePageArtworkModuleResolvers = { }, } -const HomePageArtworkModuleContextType = new GraphQLUnionType({ +const HomePageArtworkModuleContextType = new GraphQLUnionType({ name: "HomePageArtworkModuleContext", types: [ FairType, From 160fd0db8f38b18cec1f4702e47d274b280e4a16 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 13:02:10 +0100 Subject: [PATCH 04/26] refactor: reapply patches --- package.json | 2 +- ...+4.0.5.patch => graphql-tools+4.0.7.patch} | 29 ++++++++++++------- yarn.lock | 28 ++++++++++++++---- 3 files changed, 42 insertions(+), 17 deletions(-) rename patches/{graphql-tools+4.0.5.patch => graphql-tools+4.0.7.patch} (84%) diff --git a/package.json b/package.json index e724d12fa4..ce09284cd3 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "graphql-middleware": "1.2.6", "graphql-parse-resolve-info": "^4.12.3", "graphql-relay": "0.5.4", - "graphql-tools": "4.0.5", + "graphql-tools": "4.0.7", "graphql-type-json": "0.1.4", "graphql-upload": "^13.0.0", "hot-shots": "5.6.1", diff --git a/patches/graphql-tools+4.0.5.patch b/patches/graphql-tools+4.0.7.patch similarity index 84% rename from patches/graphql-tools+4.0.5.patch rename to patches/graphql-tools+4.0.7.patch index 6030bdc7e7..d3bfccd6cf 100644 --- a/patches/graphql-tools+4.0.5.patch +++ b/patches/graphql-tools+4.0.7.patch @@ -1,4 +1,5 @@ -patch-package +diff --git a/node_modules/graphql-tools/dist/stitching/resolvers.js b/node_modules/graphql-tools/dist/stitching/resolvers.js +index 5c18b05..1aaa8af 100644 --- a/node_modules/graphql-tools/dist/stitching/resolvers.js +++ b/node_modules/graphql-tools/dist/stitching/resolvers.js @@ -51,7 +51,9 @@ function createProxyingResolver(schema, operation, fieldName, transforms) { @@ -12,6 +13,8 @@ patch-package context: context, info: info, transforms: transforms, +diff --git a/node_modules/graphql-tools/dist/stitching/schemaRecreation.js b/node_modules/graphql-tools/dist/stitching/schemaRecreation.js +index b2bdfdc..07ac440 100644 --- a/node_modules/graphql-tools/dist/stitching/schemaRecreation.js +++ b/node_modules/graphql-tools/dist/stitching/schemaRecreation.js @@ -62,7 +62,9 @@ function recreateType(type, resolveType, keepResolvers) { @@ -25,31 +28,33 @@ patch-package deprecationReason: value.deprecationReason, description: value.description, astNode: value.astNode, +diff --git a/node_modules/graphql-tools/dist/transforms/FilterTypes.js b/node_modules/graphql-tools/dist/transforms/FilterTypes.js +index c947a4d..73cd984 100644 --- a/node_modules/graphql-tools/dist/transforms/FilterTypes.js +++ b/node_modules/graphql-tools/dist/transforms/FilterTypes.js -@@ -1,6 +1,8 @@ +@@ -1,6 +1,9 @@ /* tslint:disable:no-unused-expression */ Object.defineProperty(exports, "__esModule", { value: true }); var visitSchema_1 = require("../transforms/visitSchema"); +var graphql_1 = require("graphql"); +var schemaRecreation_1 = require("../stitching/schemaRecreation"); ++ var FilterTypes = /** @class */ (function () { function FilterTypes(filter) { this.filter = filter; -@@ -8,15 +10,43 @@ var FilterTypes = /** @class */ (function () { +@@ -8,15 +11,43 @@ var FilterTypes = /** @class */ (function () { FilterTypes.prototype.transformSchema = function (schema) { - var _this = this; var _a; + var _this = this; + var filteredTypes = []; + var resolveType = schemaRecreation_1.createResolveType((_name, type) => type); return visitSchema_1.visitSchema(schema, (_a = {}, _a[visitSchema_1.VisitSchemaKind.TYPE] = function (type) { if (_this.filter(type)) { -- return undefined; -+ return undefined; + return undefined; } else { -+ filteredTypes.push(type); ++ filteredTypes.push(type); return null; } }, @@ -77,13 +82,15 @@ patch-package + else { + return undefined; + } -+ }, ++ }, _a)); }; return FilterTypes; +diff --git a/node_modules/graphql-tools/dist/transforms/visitSchema.js b/node_modules/graphql-tools/dist/transforms/visitSchema.js +index b36f093..0cefb6a 100644 --- a/node_modules/graphql-tools/dist/transforms/visitSchema.js +++ b/node_modules/graphql-tools/dist/transforms/visitSchema.js -@@ -29,7 +29,35 @@ function visitSchema(schema, visitor, stripResolvers) { +@@ -36,7 +36,35 @@ function visitSchema(schema, visitor, stripResolvers) { var mutationType = schema.getMutationType(); var subscriptionType = schema.getSubscriptionType(); var typeMap = schema.getTypeMap(); @@ -116,11 +123,11 @@ patch-package + return 0; + }); + -+ typeKeys.map(function (typeName) { ++ typeKeys.map(function (typeName) { var type = typeMap[typeName]; if (graphql_1.isNamedType(type) && graphql_1.getNamedType(type).name.slice(0, 2) !== '__') { var specifiers = getTypeSpecifiers(type, schema); -@@ -60,6 +88,7 @@ function visitSchema(schema, visitor, stripResolvers) { +@@ -67,6 +95,7 @@ function visitSchema(schema, visitor, stripResolvers) { ? types[subscriptionType.name] : null, types: Object.keys(types).map(function (name) { return types[name]; }), diff --git a/yarn.lock b/yarn.lock index bc69e17ea2..98ba77f936 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2574,7 +2574,7 @@ apollo-link@1.2.1: apollo-utilities "^1.0.0" zen-observable-ts "^0.8.6" -apollo-link@^1.2.2, apollo-link@^1.2.3: +apollo-link@^1.2.2: version "1.2.12" resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.12.tgz#014b514fba95f1945c38ad4c216f31bcfee68429" integrity sha512-fsgIAXPKThyMVEMWQsUN22AoQI+J/pVXcjRGAShtk97h7D8O+SPskFinCGEkxPeQpE83uKaqafB2IyWdjN+J3Q== @@ -2584,6 +2584,16 @@ apollo-link@^1.2.2, apollo-link@^1.2.3: tslib "^1.9.3" zen-observable-ts "^0.8.19" +apollo-link@^1.2.3: + version "1.2.14" + resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" + integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== + dependencies: + apollo-utilities "^1.3.0" + ts-invariant "^0.4.0" + tslib "^1.9.3" + zen-observable-ts "^0.8.21" + apollo-utilities@^1.0.0, apollo-utilities@^1.0.1: version "1.0.12" resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.0.12.tgz#9e2b2a34cf89f3bf0d73a664effd8c1bb5d1b7f7" @@ -5042,10 +5052,10 @@ graphql-relay@0.5.4: resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.5.4.tgz#58050cfe16118595f82ab3aabfc974546ce755a8" integrity sha1-WAUM/hYRhZX4KrOqv8l0VGznVag= -graphql-tools@4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.5.tgz#d2b41ee0a330bfef833e5cdae7e1f0b0d86b1754" - integrity sha512-kQCh3IZsMqquDx7zfIGWBau42xe46gmqabwYkpPlCLIjcEY1XK+auP7iGRD9/205BPyoQdY8hT96MPpgERdC9Q== +graphql-tools@4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.7.tgz#743309b96cb657ff45b607ee0a07193cd987e43c" + integrity sha512-rApl8sT8t/W1uQRcwzxMYyUBiCl/XicluApiDkNze5TX/GR0BSTQMjM2UcRGdTmkbsb1Eqq6afkyyeG/zMxZYQ== dependencies: apollo-link "^1.2.3" apollo-utilities "^1.0.1" @@ -9857,6 +9867,14 @@ zen-observable-ts@^0.8.19: tslib "^1.9.3" zen-observable "^0.8.0" +zen-observable-ts@^0.8.21: + version "0.8.21" + resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" + integrity sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg== + dependencies: + tslib "^1.9.3" + zen-observable "^0.8.0" + zen-observable-ts@^0.8.6: version "0.8.8" resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.8.tgz#1a586dc204fa5632a88057f879500e0d2ba06869" From e4f63c379f31dc5c3fffb00638a73257c1cc4f73 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 15:19:32 +0100 Subject: [PATCH 05/26] chore: update enums to match new format --- _schemaV2.graphql | 41 +++++++++++----------- src/schema/v2/Feature/FeatureType.ts | 25 ++++++------- src/schema/v2/admin/featureFlags.ts | 2 +- src/schema/v2/artist/insights.ts | 6 ++-- src/schema/v2/auction_result.ts | 32 +++++++++-------- src/schema/v2/fair.ts | 2 +- src/schema/v2/me/collection.ts | 3 +- src/schema/v2/me/savedArtworks.ts | 2 +- src/schema/v2/me/showsByFollowedArtists.ts | 4 +-- src/schema/v2/me/showsConnection.ts | 4 +-- src/schema/v2/partner/partner.ts | 2 +- src/schema/v2/show.ts | 2 +- src/schema/v2/show_event.ts | 2 +- src/schema/v2/sorts/show_sorts.ts | 1 + 14 files changed, 64 insertions(+), 64 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 6eb070a742..1dcc273cd0 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -147,7 +147,7 @@ type Admin { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -167,7 +167,7 @@ type AdminCreateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -182,7 +182,7 @@ type AdminDeleteFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] success: Boolean } @@ -205,7 +205,7 @@ type AdminToggleFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] success: Boolean } @@ -224,7 +224,7 @@ type AdminUpdateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -1531,7 +1531,7 @@ type Artist implements EntityWithFilterArtworksConnectionInterface & Node & Sear sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection # In applicable contexts, this is what the artist (as a suggestion) is based on. @@ -1888,7 +1888,7 @@ type ArtistInsight { # Number of entities relevant to the insight. count: Int! - description(format: Format): String + description(format: Format = PLAIN): String # List of entities relevant to the insight. entities: [String!]! @@ -3888,7 +3888,7 @@ type Collection { first: Int last: Int page: Int - sort: CollectionArtworkSorts + sort: CollectionArtworkSorts = SAVED_AT_DESC ): ArtworkConnection # Number of artworks associated with this collection. @@ -9276,7 +9276,7 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String # The exhibitors with booths in this fair with letter. @@ -9557,7 +9557,7 @@ type Feature { before: String first: Int last: Int - sort: OrderedSetSorts + sort: OrderedSetSorts = KEY_ASC ): OrderedSetConnection # A slug ID. @@ -10139,7 +10139,7 @@ type FollowsAndSaves { page: Int private: Boolean = false size: Int - sort: CollectionArtworkSorts + sort: CollectionArtworkSorts = POSITION_DESC ): SavedArtworksConnection # A list of published artworks by followed artists (grouped by date and artists). @@ -11811,7 +11811,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection auctionsLotStandingConnection( after: String @@ -12066,7 +12066,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection myCollectionConnection( after: String @@ -12239,10 +12239,10 @@ type Me implements Node { before: String first: Int last: Int - sort: ShowSorts + sort: ShowSorts = CREATED_AT_DESC # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # A list of shows for the user (pagination logic might be broken) @@ -12260,10 +12260,10 @@ type Me implements Node { # Include shows within a radius of the provided location near: Near - sort: ShowSorts + sort: ShowSorts = CREATED_AT_DESC # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # A list of artworks similar to recently viewed artworks. @@ -14017,7 +14017,7 @@ type Partner implements Node { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection showsSearchConnection( after: String @@ -17546,7 +17546,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String # If the show is in a Fair, then that fair @@ -17798,7 +17798,7 @@ type ShowEventType { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String startAt( format: String @@ -17844,6 +17844,7 @@ type ShowOpenedNotificationItem { } enum ShowSorts { + CREATED_AT_DESC END_AT_ASC END_AT_DESC FEATURED_ASC diff --git a/src/schema/v2/Feature/FeatureType.ts b/src/schema/v2/Feature/FeatureType.ts index 3adba53790..49079bd939 100644 --- a/src/schema/v2/Feature/FeatureType.ts +++ b/src/schema/v2/Feature/FeatureType.ts @@ -1,25 +1,22 @@ import { - GraphQLString, + GraphQLBoolean, GraphQLNonNull, GraphQLObjectType, - GraphQLBoolean, + GraphQLString, } from "graphql" -import { Array } from "runtypes" -import { pageable } from "relay-cursor-paging" import { connectionFromArraySlice } from "graphql-relay" -import { Gravity } from "types/runtime" -import { ResolverContext } from "types/graphql" -import { SlugAndInternalIDFields } from "schema/v2/object_identification" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import { pageable } from "relay-cursor-paging" +import { Array } from "runtypes" import { markdown } from "schema/v2/fields/markdown" +import { SlugAndInternalIDFields } from "schema/v2/object_identification" +import { ResolverContext } from "types/graphql" +import { Gravity } from "types/runtime" import { OrderedSetConnection } from "../OrderedSet" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { - OrderedSetSortsEnum, - ORDERED_SET_SORTS, -} from "../OrderedSet/OrderedSetSortsEnum" +import { OrderedSetSortsEnum } from "../OrderedSet/OrderedSetSortsEnum" import Image from "../image" -import { FeatureMetaType } from "./FeatureMeta" import { FeatureLayoutsEnum } from "./FeatureLayoutsEnum" +import { FeatureMetaType } from "./FeatureMeta" export const FeatureType = new GraphQLObjectType< Gravity.Feature, @@ -52,7 +49,7 @@ export const FeatureType = new GraphQLObjectType< args: pageable({ sort: { type: OrderedSetSortsEnum, - defaultValue: ORDERED_SET_SORTS.KEY_ASC.value, + defaultValue: "KEY_ASC", }, }), description: diff --git a/src/schema/v2/admin/featureFlags.ts b/src/schema/v2/admin/featureFlags.ts index e3033106e3..25d3fba9dc 100644 --- a/src/schema/v2/admin/featureFlags.ts +++ b/src/schema/v2/admin/featureFlags.ts @@ -90,7 +90,7 @@ export const FeatureFlags: GraphQLFieldConfig = { args: { sortBy: { description: "The sort order of the results", - defaultValue: "name", + defaultValue: "NAME", type: new GraphQLEnumType({ name: "FeatureFlagsSortBy", values: { diff --git a/src/schema/v2/artist/insights.ts b/src/schema/v2/artist/insights.ts index 8eb53d2c55..7bf27fa5aa 100644 --- a/src/schema/v2/artist/insights.ts +++ b/src/schema/v2/artist/insights.ts @@ -7,6 +7,8 @@ import { GraphQLObjectType, GraphQLString, } from "graphql" +import { formatMarkdownValue } from "schema/v2/fields/markdown" +import Format from "schema/v2/input_fields/format" import { ResolverContext } from "types/graphql" import { ArtistType } from "../artist" import { @@ -14,8 +16,6 @@ import { getArtistInsights, getAuctionRecord, } from "./helpers" -import { formatMarkdownValue } from "schema/v2/fields/markdown" -import Format, { FORMATS } from "schema/v2/input_fields/format" export const ArtistInsightKind = new GraphQLEnumType({ name: "ArtistInsightKind", @@ -41,7 +41,7 @@ export const ArtistInsight = new GraphQLObjectType({ args: { format: { ...Format, - defaultValue: FORMATS.PLAIN.value, + defaultValue: "PLAIN", }, }, resolve: ({ description }, { format }) => { diff --git a/src/schema/v2/auction_result.ts b/src/schema/v2/auction_result.ts index 84aec43647..6885a996db 100644 --- a/src/schema/v2/auction_result.ts +++ b/src/schema/v2/auction_result.ts @@ -54,22 +54,24 @@ export const AuctionResultSorts = { }), } -export const AuctionResultsState: GraphQLArgumentConfig = { - type: new GraphQLEnumType({ - name: "AuctionResultsState", - values: { - ALL: { - value: "all", - }, - PAST: { - value: "past", - }, - UPCOMING: { - value: "upcoming", - }, +const AuctionResultSortsEnums = new GraphQLEnumType({ + name: "AuctionResultsState", + values: { + ALL: { + value: "all", }, - }), - defaultValue: "all", + PAST: { + value: "past", + }, + UPCOMING: { + value: "upcoming", + }, + }, +}) + +export const AuctionResultsState: GraphQLArgumentConfig = { + type: AuctionResultSortsEnums, + defaultValue: "ALL", description: "State of the returned auction results (can be past, upcoming, or all)", } diff --git a/src/schema/v2/fair.ts b/src/schema/v2/fair.ts index 85a2984dfb..0a358b2de2 100644 --- a/src/schema/v2/fair.ts +++ b/src/schema/v2/fair.ts @@ -145,7 +145,7 @@ export const FairType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: "LONG", }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/me/collection.ts b/src/schema/v2/me/collection.ts index ef6a0c15df..26b959f5fa 100644 --- a/src/schema/v2/me/collection.ts +++ b/src/schema/v2/me/collection.ts @@ -28,8 +28,7 @@ export const CollectionType = new GraphQLObjectType({ ...pageable({ sort: { type: CollectionArtworkSorts, - defaultValue: CollectionArtworkSorts.getValue("SAVED_AT_DESC")! - .value, + defaultValue: "SAVED_AT_DESC", }, page: { type: GraphQLInt }, }), diff --git a/src/schema/v2/me/savedArtworks.ts b/src/schema/v2/me/savedArtworks.ts index a8fede1786..0195b2d9fa 100644 --- a/src/schema/v2/me/savedArtworks.ts +++ b/src/schema/v2/me/savedArtworks.ts @@ -48,7 +48,7 @@ export const SavedArtworks: GraphQLFieldConfig = { }, sort: { type: CollectionArtworkSorts, - defaultValue: "-position", + defaultValue: "POSITION_DESC", }, page: { type: GraphQLInt }, size: { type: GraphQLInt }, diff --git a/src/schema/v2/me/showsByFollowedArtists.ts b/src/schema/v2/me/showsByFollowedArtists.ts index 2cc601bf71..47b391be88 100644 --- a/src/schema/v2/me/showsByFollowedArtists.ts +++ b/src/schema/v2/me/showsByFollowedArtists.ts @@ -14,11 +14,11 @@ export const ShowsByFollowedArtists: GraphQLFieldConfig< args: pageable({ sort: { type: ShowSorts, - defaultValue: "-created_at", + defaultValue: "CREATED_AT_DESC", }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: "CURRENT", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/me/showsConnection.ts b/src/schema/v2/me/showsConnection.ts index cc8c050f35..4a50fc3e8c 100644 --- a/src/schema/v2/me/showsConnection.ts +++ b/src/schema/v2/me/showsConnection.ts @@ -28,11 +28,11 @@ export const ShowsConnection: GraphQLFieldConfig = { }, sort: { type: ShowSorts, - defaultValue: "-created_at", + defaultValue: "CREATED_AT_DESC", }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: "CURRENT", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/partner/partner.ts b/src/schema/v2/partner/partner.ts index f5c52d26d3..9fbc40a3c4 100644 --- a/src/schema/v2/partner/partner.ts +++ b/src/schema/v2/partner/partner.ts @@ -776,7 +776,7 @@ export const PartnerType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: "CURRENT", description: "Filter shows by chronological event status", }, isDisplayable: { diff --git a/src/schema/v2/show.ts b/src/schema/v2/show.ts index 08b6dad47b..fc8135aa8f 100644 --- a/src/schema/v2/show.ts +++ b/src/schema/v2/show.ts @@ -343,7 +343,7 @@ export const ShowType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: "LONG", }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/show_event.ts b/src/schema/v2/show_event.ts index 0c39252ce6..c590695412 100644 --- a/src/schema/v2/show_event.ts +++ b/src/schema/v2/show_event.ts @@ -36,7 +36,7 @@ const ShowEventType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: "LONG", }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/sorts/show_sorts.ts b/src/schema/v2/sorts/show_sorts.ts index e9b3a12a19..49b1677783 100644 --- a/src/schema/v2/sorts/show_sorts.ts +++ b/src/schema/v2/sorts/show_sorts.ts @@ -1,6 +1,7 @@ import { GraphQLEnumType } from "graphql" const SHOW_SORTS = { + CREATED_AT_DESC: { value: "-created_at" }, END_AT_ASC: { value: "end_at" }, END_AT_DESC: { value: "-end_at" }, FEATURED_ASC: { value: "featured" }, From 729275d212245cfeb3c72a5f8e70c0a20c0aa73c Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 15:48:23 +0100 Subject: [PATCH 06/26] fix: add missing aggregate-error --- package.json | 3 +- src/index.ts | 2 +- yarn.lock | 101 +++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 88 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index ce09284cd3..326737d5d9 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "author": "Art.sy Inc", "license": "MIT", "dependencies": { + "@ardatan/aggregate-error": "^0.0.6", "@artsy/img": "1.0.3", "@artsy/morgan": "^1.0.2", "@artsy/multienv": "^1.2.0", @@ -65,7 +66,7 @@ "google-libphonenumber": "^3.2.25", "graphql": "15.8.0", "graphql-depth-limit": "1.1.0", - "graphql-middleware": "1.2.6", + "graphql-middleware": "6.1.32", "graphql-parse-resolve-info": "^4.12.3", "graphql-relay": "0.5.4", "graphql-tools": "4.0.7", diff --git a/src/index.ts b/src/index.ts index e78fe5acd5..ff2a6dd28d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -140,7 +140,7 @@ app.use( const exchangeSchema = executableExchangeSchema(legacyTransformsForExchange) -const graphqlHTTP = require("express-graphql") +const { graphqlHTTP } = require("express-graphql") const graphqlServer = graphqlHTTP((req, res, params) => { const accessToken = req.headers["x-access-token"] as string | undefined const appToken = req.headers["x-xapp-token"] as string | undefined diff --git a/yarn.lock b/yarn.lock index 98ba77f936..5cf36c91ca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,13 @@ # yarn lockfile v1 +"@ardatan/aggregate-error@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@ardatan/aggregate-error/-/aggregate-error-0.0.6.tgz#fe6924771ea40fc98dc7a7045c2e872dc8527609" + integrity sha512-vyrkEHG1jrukmzTPtyWB4NLPauUw5bQeg4uhn8f+1SSynmrOcyvlb1GKQjjgoBzElLdfXCRYX8UnBlhklOHYRQ== + dependencies: + tslib "~2.0.1" + "@artsy/express-reloadable@1.7.0": version "1.7.0" resolved "https://registry.yarnpkg.com/@artsy/express-reloadable/-/express-reloadable-1.7.0.tgz#af8f93aea5ad8cf6ebb90d9be484c3e19269ffb6" @@ -1247,6 +1254,16 @@ dependencies: dependency-graph "0.8.1" +"@graphql-tools/batch-execute@8.5.1": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-execute/-/batch-execute-8.5.1.tgz#fa3321d58c64041650be44250b1ebc3aab0ba7a9" + integrity sha512-hRVDduX0UDEneVyEWtc2nu5H2PxpfSfM/riUlgZvo/a/nG475uyehxR5cFGvTEPEQUKY3vGIlqvtRigzqTfCew== + dependencies: + "@graphql-tools/utils" "8.9.0" + dataloader "2.1.0" + tslib "^2.4.0" + value-or-promise "1.0.11" + "@graphql-tools/delegate@6.0.10": version "6.0.10" resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-6.0.10.tgz#f2fe8eea6cd5ce23f1e8f3dacfa6e136cad157da" @@ -1257,6 +1274,26 @@ aggregate-error "3.0.1" tslib "~2.0.0" +"@graphql-tools/delegate@^8.8.1": + version "8.8.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-8.8.1.tgz#0653a72f38947f38ab7917dfac50ebf6a6b883e9" + integrity sha512-NDcg3GEQmdEHlnF7QS8b4lM1PSF+DKeFcIlLEfZFBvVq84791UtJcDj8734sIHLukmyuAxXMfA1qLd2l4lZqzA== + dependencies: + "@graphql-tools/batch-execute" "8.5.1" + "@graphql-tools/schema" "8.5.1" + "@graphql-tools/utils" "8.9.0" + dataloader "2.1.0" + tslib "~2.4.0" + value-or-promise "1.0.11" + +"@graphql-tools/merge@8.3.1": + version "8.3.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/merge/-/merge-8.3.1.tgz#06121942ad28982a14635dbc87b5d488a041d722" + integrity sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg== + dependencies: + "@graphql-tools/utils" "8.9.0" + tslib "^2.4.0" + "@graphql-tools/schema@6.0.10": version "6.0.10" resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-6.0.10.tgz#69b36fad35ea5780f8539c92e776f9e83d929575" @@ -1265,6 +1302,16 @@ "@graphql-tools/utils" "6.0.10" tslib "~2.0.0" +"@graphql-tools/schema@8.5.1", "@graphql-tools/schema@^8.5.1": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/schema/-/schema-8.5.1.tgz#c2f2ff1448380919a330312399c9471db2580b58" + integrity sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg== + dependencies: + "@graphql-tools/merge" "8.3.1" + "@graphql-tools/utils" "8.9.0" + tslib "^2.4.0" + value-or-promise "1.0.11" + "@graphql-tools/utils@6.0.10": version "6.0.10" resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-6.0.10.tgz#ed15110a20acc5474a8dda5c0b99f970ba696c75" @@ -1273,6 +1320,13 @@ aggregate-error "3.0.1" camel-case "4.1.1" +"@graphql-tools/utils@8.9.0": + version "8.9.0" + resolved "https://registry.yarnpkg.com/@graphql-tools/utils/-/utils-8.9.0.tgz#c6aa5f651c9c99e1aca55510af21b56ec296cdb7" + integrity sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg== + dependencies: + tslib "^2.4.0" + "@jest/console@^24.7.1": version "24.7.1" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" @@ -3701,6 +3755,11 @@ dataloader@1.3.0: resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.3.0.tgz#6fec5be4b30a712e4afd30b86b4334566b97673b" integrity sha1-b+xb5LMKcS5K/TC4a0M0VmuXZzs= +dataloader@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-2.1.0.tgz#c69c538235e85e7ac6c6c444bae8ecabf5de9df7" + integrity sha512-qTcEYLen3r7ojZNgVUaRggOI+KM7jrKxXeSHhogh/TWxYMeONEMqY+hmkobiYQozsGIyg9OYVzO4ZIfoB4I0pQ== + date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" @@ -5032,12 +5091,13 @@ graphql-depth-limit@1.1.0: dependencies: arrify "^1.0.1" -graphql-middleware@1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/graphql-middleware/-/graphql-middleware-1.2.6.tgz#11392687aaa2ef7cc90d46b8ac883d60b526b56d" - integrity sha512-+agrI6GvkRx0jZTBAjzcmA49qE2B5y7RJBHolPO5EpZpBXSRw+vrHniXxfuXJyZo47uEsgTIfM2mTR9U2fKVvw== +graphql-middleware@6.1.32: + version "6.1.32" + resolved "https://registry.yarnpkg.com/graphql-middleware/-/graphql-middleware-6.1.32.tgz#1b8a121d615efcf6d4b21d63f0a4818189700e0a" + integrity sha512-4vL+o9lljc1JavXNtMZg+gwDiZ9ORhgzAxf+7ef8r9/gn6D5sWxm2w8SdG6PLkKOsSM/tDunwSpfSJinn0XPCw== dependencies: - graphql-tools "^3.0.2" + "@graphql-tools/delegate" "^8.8.1" + "@graphql-tools/schema" "^8.5.1" graphql-parse-resolve-info@^4.12.3: version "4.12.3" @@ -5063,17 +5123,6 @@ graphql-tools@4.0.7: iterall "^1.1.3" uuid "^3.1.0" -graphql-tools@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-3.0.2.tgz#fb79821c23b0f5d11d842c4d0c15000d856c6c8c" - integrity sha512-bhDGrvmSgcJBFX3EZEYagmKPk/EJ9vZIcF1WtSFveWfvSsh7crMFSQ9ldftuIXC9UeRwfutpGf3A1q4UpVLaRg== - dependencies: - apollo-link "1.2.1" - apollo-utilities "^1.0.1" - deprecated-decorator "^0.1.6" - iterall "^1.1.3" - uuid "^3.1.0" - graphql-type-json@0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/graphql-type-json/-/graphql-type-json-0.1.4.tgz#89f13f5d32ce08c9a76c79fdf9c1968384d81a4e" @@ -9426,11 +9475,26 @@ tslib@^2.0.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^2.4.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tslib@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3" integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g== +tslib@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" + integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== + +tslib@~2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== + tsutils@^3.17.1: version "3.17.1" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" @@ -9654,6 +9718,11 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +value-or-promise@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/value-or-promise/-/value-or-promise-1.0.11.tgz#3e90299af31dd014fe843fe309cefa7c1d94b140" + integrity sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg== + vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" From 541802102dfc5e1aed1f97e339b80c32e3a08969 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 16:07:14 +0100 Subject: [PATCH 07/26] chore: update apollo related packages --- package.json | 6 ++-- yarn.lock | 82 ++++++++++++++-------------------------------------- 2 files changed, 24 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index 326737d5d9..b8f211c407 100644 --- a/package.json +++ b/package.json @@ -45,9 +45,9 @@ "@graphql-tools/delegate": "6.0.10", "@sentry/node": "5.18.1", "accounting": "0.4.1", - "apollo-link": "1.2.1", - "apollo-link-context": "1.0.8", - "apollo-link-http": "1.5.4", + "apollo-link": "^1.2.14", + "apollo-link-context": "^1.0.20", + "apollo-link-http": "^1.5.17", "basic-auth": "1.1.0", "body-parser": "1.18.2", "chalk": "^4.1.2", diff --git a/yarn.lock b/yarn.lock index 5cf36c91ca..786b08614f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2246,11 +2246,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@^9.4.6": - version "9.4.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.7.tgz#57d81cd98719df2c9de118f2d5f3b1120dcd7275" - integrity sha512-4Ba90mWNx8ddbafuyGGwjkZMigi+AWfYLSDCpovwsE63ia8w93r3oJ8PIAQc3y8U+XHcnMOHPIzNe3o438Ywcw== - "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -2597,48 +2592,33 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" -apollo-link-context@1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/apollo-link-context/-/apollo-link-context-1.0.8.tgz#c967a56ac6ed32add748937735bcb57c5cc64c95" - integrity sha512-wgDwBbWqHblf7W0DD2b80kXLtSAfvbXnsxSrli0GuF77VwxjLChijiHinW5bjurzZvP8YRMNhitmrrF5ia7NsA== - dependencies: - apollo-link "^1.2.2" - -apollo-link-http-common@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.4.tgz#877603f7904dc8f70242cac61808b1f8d034b2c3" - integrity sha512-4j6o6WoXuSPen9xh4NBaX8/vL98X1xY2cYzUEK1F8SzvHe2oFONfxJBTekwU8hnvapcuq8Qh9Uct+gelu8T10g== +apollo-link-context@^1.0.20: + version "1.0.20" + resolved "https://registry.yarnpkg.com/apollo-link-context/-/apollo-link-context-1.0.20.tgz#1939ac5dc65d6dff0c855ee53521150053c24676" + integrity sha512-MLLPYvhzNb8AglNsk2NcL9AvhO/Vc9hn2ZZuegbhRHGet3oGr0YH9s30NS9+ieoM0sGT11p7oZ6oAILM/kiRBA== dependencies: - apollo-link "^1.2.2" - -apollo-link-http@1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.4.tgz#b80b7b4b342c655b6a5614624b076a36be368f43" - integrity sha512-e9Ng3HfnW00Mh3TI6DhNRfozmzQOtKgdi+qUAsHBOEcTP0PTAmb+9XpeyEEOueLyO0GXhB92HUCIhzrWMXgwyg== - dependencies: - apollo-link "^1.2.2" - apollo-link-http-common "^0.2.4" + apollo-link "^1.2.14" + tslib "^1.9.3" -apollo-link@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.1.tgz#c120b16059f9bd93401b9f72b94d2f80f3f305d2" - integrity sha512-6Ghf+j3cQLCIvjXd2dJrLw+16HZbWbwmB1qlTc41BviB2hv+rK1nJr17Y9dWK0UD4p3i9Hfddx3tthpMKrueHg== +apollo-link-http-common@^0.2.16: + version "0.2.16" + resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz#756749dafc732792c8ca0923f9a40564b7c59ecc" + integrity sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg== dependencies: - "@types/node" "^9.4.6" - apollo-utilities "^1.0.0" - zen-observable-ts "^0.8.6" + apollo-link "^1.2.14" + ts-invariant "^0.4.0" + tslib "^1.9.3" -apollo-link@^1.2.2: - version "1.2.12" - resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.12.tgz#014b514fba95f1945c38ad4c216f31bcfee68429" - integrity sha512-fsgIAXPKThyMVEMWQsUN22AoQI+J/pVXcjRGAShtk97h7D8O+SPskFinCGEkxPeQpE83uKaqafB2IyWdjN+J3Q== +apollo-link-http@^1.5.17: + version "1.5.17" + resolved "https://registry.yarnpkg.com/apollo-link-http/-/apollo-link-http-1.5.17.tgz#499e9f1711bf694497f02c51af12d82de5d8d8ba" + integrity sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg== dependencies: - apollo-utilities "^1.3.0" - ts-invariant "^0.4.0" + apollo-link "^1.2.14" + apollo-link-http-common "^0.2.16" tslib "^1.9.3" - zen-observable-ts "^0.8.19" -apollo-link@^1.2.3: +apollo-link@^1.2.14, apollo-link@^1.2.3: version "1.2.14" resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== @@ -2648,7 +2628,7 @@ apollo-link@^1.2.3: tslib "^1.9.3" zen-observable-ts "^0.8.21" -apollo-utilities@^1.0.0, apollo-utilities@^1.0.1: +apollo-utilities@^1.0.1: version "1.0.12" resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.0.12.tgz#9e2b2a34cf89f3bf0d73a664effd8c1bb5d1b7f7" integrity sha512-3mSen+NLouRwhmzCSHbMICfLBa6J+QJOc+M8zzLyo10jAYsOK+A2VgR63q4mcQJmAp8LumC5VAyah1zw6enMcg== @@ -9928,14 +9908,6 @@ yargs@^13.3.0: y18n "^4.0.0" yargs-parser "^13.1.1" -zen-observable-ts@^0.8.19: - version "0.8.19" - resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.19.tgz#c094cd20e83ddb02a11144a6e2a89706946b5694" - integrity sha512-u1a2rpE13G+jSzrg3aiCqXU5tN2kw41b+cBZGmnc+30YimdkKiDj9bTowcB41eL77/17RF/h+393AuVgShyheQ== - dependencies: - tslib "^1.9.3" - zen-observable "^0.8.0" - zen-observable-ts@^0.8.21: version "0.8.21" resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d" @@ -9944,18 +9916,6 @@ zen-observable-ts@^0.8.21: tslib "^1.9.3" zen-observable "^0.8.0" -zen-observable-ts@^0.8.6: - version "0.8.8" - resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.8.tgz#1a586dc204fa5632a88057f879500e0d2ba06869" - integrity sha512-oGjFvBbAA94uh/HvAwJDwMHtNq4lZRtupJx8XsyreOTYvH8x1ef9hIeH/M+IqiAXtNpglq/Klh5rbpYWEeRSOQ== - dependencies: - zen-observable "^0.7.0" - -zen-observable@^0.7.0: - version "0.7.1" - resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.7.1.tgz#f84075c0ee085594d3566e1d6454207f126411b3" - integrity sha512-OI6VMSe0yeqaouIXtedC+F55Sr6r9ppS7+wTbSexkYdHbdt4ctTuPNXP/rwm7GTVI63YBc+EBT0b0tl7YnJLRg== - zen-observable@^0.8.0: version "0.8.8" resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.8.tgz#1ea93995bf098754a58215a1e0a7309e5749ec42" From 1b060650ab002f1f40bd13ff1d57f7262eb26646 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 17:15:04 +0100 Subject: [PATCH 08/26] chore: update graphl relay to 0.6.0 --- package.json | 2 +- ...elay+0.5.4.patch => graphql-relay+0.6.0.patch} | 0 yarn.lock | 15 +++++++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) rename patches/{graphql-relay+0.5.4.patch => graphql-relay+0.6.0.patch} (100%) diff --git a/package.json b/package.json index b8f211c407..608f7c0020 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "graphql-depth-limit": "1.1.0", "graphql-middleware": "6.1.32", "graphql-parse-resolve-info": "^4.12.3", - "graphql-relay": "0.5.4", + "graphql-relay": "0.6.0", "graphql-tools": "4.0.7", "graphql-type-json": "0.1.4", "graphql-upload": "^13.0.0", diff --git a/patches/graphql-relay+0.5.4.patch b/patches/graphql-relay+0.6.0.patch similarity index 100% rename from patches/graphql-relay+0.5.4.patch rename to patches/graphql-relay+0.6.0.patch diff --git a/yarn.lock b/yarn.lock index 786b08614f..4714e454d2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5087,10 +5087,12 @@ graphql-parse-resolve-info@^4.12.3: debug "^4.1.1" tslib "^2.0.1" -graphql-relay@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.5.4.tgz#58050cfe16118595f82ab3aabfc974546ce755a8" - integrity sha1-WAUM/hYRhZX4KrOqv8l0VGznVag= +graphql-relay@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.6.0.tgz#18ec36b772cfcb3dbb9bd369c3f8004cf42c7b93" + integrity sha512-OVDi6C9/qOT542Q3KxZdXja3NrDvqzbihn1B44PH8P/c5s0Q90RyQwT6guhGqXqbYEH6zbeLJWjQqiYvcg2vVw== + dependencies: + prettier "^1.16.0" graphql-tools@4.0.7: version "4.0.7" @@ -7940,6 +7942,11 @@ prettier@2.0.5: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== +prettier@^1.16.0: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + pretty-format@^22.4.3: version "22.4.3" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.4.3.tgz#f873d780839a9c02e9664c8a082e9ee79eaac16f" From f0dce8267b2e783d01f7d507e9208deb3ca371f1 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 17:51:23 +0100 Subject: [PATCH 09/26] chore: update graphql-relay --- package.json | 2 +- patches/graphql-relay+0.6.0.patch | 90 ------------------------------- patches/graphql-relay+0.7.0.patch | 90 +++++++++++++++++++++++++++++++ yarn.lock | 15 ++---- 4 files changed, 95 insertions(+), 102 deletions(-) delete mode 100644 patches/graphql-relay+0.6.0.patch create mode 100644 patches/graphql-relay+0.7.0.patch diff --git a/package.json b/package.json index 608f7c0020..993fad805e 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "graphql-depth-limit": "1.1.0", "graphql-middleware": "6.1.32", "graphql-parse-resolve-info": "^4.12.3", - "graphql-relay": "0.6.0", + "graphql-relay": "0.7.0", "graphql-tools": "4.0.7", "graphql-type-json": "0.1.4", "graphql-upload": "^13.0.0", diff --git a/patches/graphql-relay+0.6.0.patch b/patches/graphql-relay+0.6.0.patch deleted file mode 100644 index ac4258da24..0000000000 --- a/patches/graphql-relay+0.6.0.patch +++ /dev/null @@ -1,90 +0,0 @@ -patch-package ---- a/node_modules/graphql-relay/lib/connection/arrayconnection.js -+++ b/node_modules/graphql-relay/lib/connection/arrayconnection.js -@@ -60,7 +60,9 @@ function connectionFromArraySlice(arraySlice, args, meta) { - first = args.first, - last = args.last; - var sliceStart = meta.sliceStart, -- arrayLength = meta.arrayLength; -+ arrayLength = meta.arrayLength, -+ resolveNode = meta.resolveNode, -+ useValueAsEdge = meta.useValueAsEdge; - - var sliceEnd = sliceStart + arraySlice.length; - var beforeOffset = getOffsetWithDefault(before, arrayLength); -@@ -87,10 +89,18 @@ function connectionFromArraySlice(arraySlice, args, meta) { - var slice = arraySlice.slice(Math.max(startOffset - sliceStart, 0), arraySlice.length - (sliceEnd - endOffset)); - - var edges = slice.map(function (value, index) { -- return { -+ const newEdge = useValueAsEdge ? { -+ ...value, - cursor: offsetToCursor(startOffset + index), -- node: value -+ } : { -+ cursor: offsetToCursor(startOffset + index), -+ node: !!resolveNode ? resolveNode(value) : value, - }; -+ -+ if (resolveNode) { -+ return { ...value, ...newEdge }; -+ } -+ return newEdge; - }); - - var firstEdge = edges[0]; ---- a/node_modules/graphql-relay/lib/connection/connection.js -+++ b/node_modules/graphql-relay/lib/connection/connection.js -@@ -3,7 +3,7 @@ - Object.defineProperty(exports, "__esModule", { - value: true - }); --exports.connectionArgs = exports.backwardConnectionArgs = exports.forwardConnectionArgs = undefined; -+exports.connectionArgs = exports.backwardConnectionArgs = exports.forwardConnectionArgs = exports.PageInfoType = undefined; - - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** - * Copyright (c) 2015-present, Facebook, Inc. -@@ -66,9 +66,10 @@ function connectionDefinitions(config) { - var connectionFields = config.connectionFields || {}; - var resolveNode = config.resolveNode; - var resolveCursor = config.resolveCursor; -- var edgeType = new _graphql.GraphQLObjectType({ -+ var edgeType = config.edgeType || new _graphql.GraphQLObjectType({ - name: name + 'Edge', - description: 'An edge in a connection.', -+ interfaces: config.edgeInterfaces, - fields: function fields() { - return _extends({ - node: { -@@ -88,6 +89,7 @@ function connectionDefinitions(config) { - var connectionType = new _graphql.GraphQLObjectType({ - name: name + 'Connection', - description: 'A connection to a list of items.', -+ interfaces: config.connectionInterfaces, - fields: function fields() { - return _extends({ - pageInfo: { -@@ -108,7 +110,7 @@ function connectionDefinitions(config) { - /** - * The common page info type used by all connections. - */ --var pageInfoType = new _graphql.GraphQLObjectType({ -+var pageInfoType = exports.PageInfoType = new _graphql.GraphQLObjectType({ - name: 'PageInfo', - description: 'Information about pagination in a connection.', - fields: function fields() { ---- a/node_modules/graphql-relay/lib/index.js -+++ b/node_modules/graphql-relay/lib/index.js -@@ -30,6 +30,12 @@ Object.defineProperty(exports, 'forwardConnectionArgs', { - return _connection.forwardConnectionArgs; - } - }); -+Object.defineProperty(exports, 'PageInfoType', { -+ enumerable: true, -+ get: function get() { -+ return _connection.PageInfoType; -+ } -+}); - - var _arrayconnection = require('./connection/arrayconnection.js'); - diff --git a/patches/graphql-relay+0.7.0.patch b/patches/graphql-relay+0.7.0.patch new file mode 100644 index 0000000000..35bc9fb3d0 --- /dev/null +++ b/patches/graphql-relay+0.7.0.patch @@ -0,0 +1,90 @@ +diff --git a/node_modules/graphql-relay/connection/arrayConnection.js b/node_modules/graphql-relay/connection/arrayConnection.js +index 5a42ae5..bec0ba9 100644 +--- a/node_modules/graphql-relay/connection/arrayConnection.js ++++ b/node_modules/graphql-relay/connection/arrayConnection.js +@@ -80,10 +80,22 @@ function connectionFromArraySlice(arraySlice, args, meta) { + + + const slice = arraySlice.slice(Math.max(startOffset - sliceStart, 0), arraySlice.length - (sliceEnd - endOffset)); +- const edges = slice.map((value, index) => ({ +- cursor: offsetToCursor(startOffset + index), +- node: value +- })); ++ const edges = slice.map((value, index) => { ++ const newEdge = meta.useValueAsEdge ? { ++ ...value, ++ cursor: offsetToCursor(startOffset + index), ++ }: ++ { ++ cursor: offsetToCursor(startOffset + index), ++ node: !!meta.resolveNode ? meta.resolveNode(value) : value, ++ }; ++ ++ if (meta.resolveNode) { ++ return { ...value, ...newEdge }; ++ } ++ ++ return newEdge; ++ }); + const firstEdge = edges[0]; + const lastEdge = edges[edges.length - 1]; + const lowerBound = after != null ? afterOffset + 1 : 0; +diff --git a/node_modules/graphql-relay/connection/connection.js b/node_modules/graphql-relay/connection/connection.js +index 23c916f..081f3b3 100644 +--- a/node_modules/graphql-relay/connection/connection.js ++++ b/node_modules/graphql-relay/connection/connection.js +@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.connectionDefinitions = connectionDefinitions; +-exports.connectionArgs = exports.backwardConnectionArgs = exports.forwardConnectionArgs = void 0; ++exports.connectionArgs = exports.backwardConnectionArgs = exports.forwardConnectionArgs = exports.PageInfoType = void 0; + + var _graphql = require("graphql"); + +@@ -70,9 +70,10 @@ function connectionDefinitions(config) { + nodeType + } = config; + const name = (_config$name = config.name) !== null && _config$name !== void 0 ? _config$name : (0, _graphql.getNamedType)(nodeType).name; +- const edgeType = new _graphql.GraphQLObjectType({ ++ const edgeType = config.edgeType || new _graphql.GraphQLObjectType({ + name: name + 'Edge', + description: 'An edge in a connection.', ++ interfaces: config.edgeInterfaces, + fields: () => { + var _config$edgeFields; + +@@ -94,6 +95,7 @@ function connectionDefinitions(config) { + const connectionType = new _graphql.GraphQLObjectType({ + name: name + 'Connection', + description: 'A connection to a list of items.', ++ interfaces: config.connectionInterfaces, + fields: () => { + var _config$connectionFie; + +@@ -123,7 +125,7 @@ function connectionDefinitions(config) { + /** + * The common page info type used by all connections. + */ +-const pageInfoType = new _graphql.GraphQLObjectType({ ++const pageInfoType = exports.PageInfoType = new _graphql.GraphQLObjectType({ + name: 'PageInfo', + description: 'Information about pagination in a connection.', + fields: () => ({ +diff --git a/node_modules/graphql-relay/index.js b/node_modules/graphql-relay/index.js +index 670c089..77a49e6 100644 +--- a/node_modules/graphql-relay/index.js ++++ b/node_modules/graphql-relay/index.js +@@ -27,6 +27,12 @@ Object.defineProperty(exports, "forwardConnectionArgs", { + return _connection.forwardConnectionArgs; + } + }); ++Object.defineProperty(exports, 'PageInfoType', { ++ enumerable: true, ++ get: function get() { ++ return _connection.PageInfoType; ++ } ++}); + Object.defineProperty(exports, "connectionFromArray", { + enumerable: true, + get: function () { diff --git a/yarn.lock b/yarn.lock index 4714e454d2..55d6bd8f86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5087,12 +5087,10 @@ graphql-parse-resolve-info@^4.12.3: debug "^4.1.1" tslib "^2.0.1" -graphql-relay@0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.6.0.tgz#18ec36b772cfcb3dbb9bd369c3f8004cf42c7b93" - integrity sha512-OVDi6C9/qOT542Q3KxZdXja3NrDvqzbihn1B44PH8P/c5s0Q90RyQwT6guhGqXqbYEH6zbeLJWjQqiYvcg2vVw== - dependencies: - prettier "^1.16.0" +graphql-relay@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.7.0.tgz#e5c7a4bb52ede09e90e92dfd7b89d5947362278b" + integrity sha512-P8eS3IbZRhbfbcfud1Q6VPrIru4hchkb15MuOij+WQo9r0chD5NBIxiVjuRE2iG2EMHxIOrZb8LnMe82+YdITA== graphql-tools@4.0.7: version "4.0.7" @@ -7942,11 +7940,6 @@ prettier@2.0.5: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== -prettier@^1.16.0: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== - pretty-format@^22.4.3: version "22.4.3" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.4.3.tgz#f873d780839a9c02e9664c8a082e9ee79eaac16f" From 3831a94cb629a606478910ef31a29b56b49ba6ff Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 17:52:38 +0100 Subject: [PATCH 10/26] Revert "chore: update enums to match new format" This reverts commit b6eb6ed7cb6e73707694faa21278cc5708fec016. --- _schemaV2.graphql | 41 +++++++++++----------- src/schema/v2/Feature/FeatureType.ts | 25 +++++++------ src/schema/v2/admin/featureFlags.ts | 2 +- src/schema/v2/artist/insights.ts | 6 ++-- src/schema/v2/auction_result.ts | 32 ++++++++--------- src/schema/v2/fair.ts | 2 +- src/schema/v2/me/collection.ts | 3 +- src/schema/v2/me/savedArtworks.ts | 2 +- src/schema/v2/me/showsByFollowedArtists.ts | 4 +-- src/schema/v2/me/showsConnection.ts | 4 +-- src/schema/v2/partner/partner.ts | 2 +- src/schema/v2/show.ts | 2 +- src/schema/v2/show_event.ts | 2 +- src/schema/v2/sorts/show_sorts.ts | 1 - 14 files changed, 64 insertions(+), 64 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 1dcc273cd0..6eb070a742 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -147,7 +147,7 @@ type Admin { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] } @@ -167,7 +167,7 @@ type AdminCreateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] } @@ -182,7 +182,7 @@ type AdminDeleteFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] success: Boolean } @@ -205,7 +205,7 @@ type AdminToggleFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] success: Boolean } @@ -224,7 +224,7 @@ type AdminUpdateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] } @@ -1531,7 +1531,7 @@ type Artist implements EntityWithFilterArtworksConnectionInterface & Node & Sear sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState = ALL + state: AuctionResultsState ): AuctionResultConnection # In applicable contexts, this is what the artist (as a suggestion) is based on. @@ -1888,7 +1888,7 @@ type ArtistInsight { # Number of entities relevant to the insight. count: Int! - description(format: Format = PLAIN): String + description(format: Format): String # List of entities relevant to the insight. entities: [String!]! @@ -3888,7 +3888,7 @@ type Collection { first: Int last: Int page: Int - sort: CollectionArtworkSorts = SAVED_AT_DESC + sort: CollectionArtworkSorts ): ArtworkConnection # Number of artworks associated with this collection. @@ -9276,7 +9276,7 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat = LONG + format: ExhibitionPeriodFormat ): String # The exhibitors with booths in this fair with letter. @@ -9557,7 +9557,7 @@ type Feature { before: String first: Int last: Int - sort: OrderedSetSorts = KEY_ASC + sort: OrderedSetSorts ): OrderedSetConnection # A slug ID. @@ -10139,7 +10139,7 @@ type FollowsAndSaves { page: Int private: Boolean = false size: Int - sort: CollectionArtworkSorts = POSITION_DESC + sort: CollectionArtworkSorts ): SavedArtworksConnection # A list of published artworks by followed artists (grouped by date and artists). @@ -11811,7 +11811,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState = ALL + state: AuctionResultsState ): AuctionResultConnection auctionsLotStandingConnection( after: String @@ -12066,7 +12066,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState = ALL + state: AuctionResultsState ): AuctionResultConnection myCollectionConnection( after: String @@ -12239,10 +12239,10 @@ type Me implements Node { before: String first: Int last: Int - sort: ShowSorts = CREATED_AT_DESC + sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection # A list of shows for the user (pagination logic might be broken) @@ -12260,10 +12260,10 @@ type Me implements Node { # Include shows within a radius of the provided location near: Near - sort: ShowSorts = CREATED_AT_DESC + sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection # A list of artworks similar to recently viewed artworks. @@ -14017,7 +14017,7 @@ type Partner implements Node { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection showsSearchConnection( after: String @@ -17546,7 +17546,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat = LONG + format: ExhibitionPeriodFormat ): String # If the show is in a Fair, then that fair @@ -17798,7 +17798,7 @@ type ShowEventType { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat = LONG + format: ExhibitionPeriodFormat ): String startAt( format: String @@ -17844,7 +17844,6 @@ type ShowOpenedNotificationItem { } enum ShowSorts { - CREATED_AT_DESC END_AT_ASC END_AT_DESC FEATURED_ASC diff --git a/src/schema/v2/Feature/FeatureType.ts b/src/schema/v2/Feature/FeatureType.ts index 49079bd939..3adba53790 100644 --- a/src/schema/v2/Feature/FeatureType.ts +++ b/src/schema/v2/Feature/FeatureType.ts @@ -1,22 +1,25 @@ import { - GraphQLBoolean, + GraphQLString, GraphQLNonNull, GraphQLObjectType, - GraphQLString, + GraphQLBoolean, } from "graphql" -import { connectionFromArraySlice } from "graphql-relay" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { pageable } from "relay-cursor-paging" import { Array } from "runtypes" -import { markdown } from "schema/v2/fields/markdown" -import { SlugAndInternalIDFields } from "schema/v2/object_identification" -import { ResolverContext } from "types/graphql" +import { pageable } from "relay-cursor-paging" +import { connectionFromArraySlice } from "graphql-relay" import { Gravity } from "types/runtime" +import { ResolverContext } from "types/graphql" +import { SlugAndInternalIDFields } from "schema/v2/object_identification" +import { markdown } from "schema/v2/fields/markdown" import { OrderedSetConnection } from "../OrderedSet" -import { OrderedSetSortsEnum } from "../OrderedSet/OrderedSetSortsEnum" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import { + OrderedSetSortsEnum, + ORDERED_SET_SORTS, +} from "../OrderedSet/OrderedSetSortsEnum" import Image from "../image" -import { FeatureLayoutsEnum } from "./FeatureLayoutsEnum" import { FeatureMetaType } from "./FeatureMeta" +import { FeatureLayoutsEnum } from "./FeatureLayoutsEnum" export const FeatureType = new GraphQLObjectType< Gravity.Feature, @@ -49,7 +52,7 @@ export const FeatureType = new GraphQLObjectType< args: pageable({ sort: { type: OrderedSetSortsEnum, - defaultValue: "KEY_ASC", + defaultValue: ORDERED_SET_SORTS.KEY_ASC.value, }, }), description: diff --git a/src/schema/v2/admin/featureFlags.ts b/src/schema/v2/admin/featureFlags.ts index 25d3fba9dc..e3033106e3 100644 --- a/src/schema/v2/admin/featureFlags.ts +++ b/src/schema/v2/admin/featureFlags.ts @@ -90,7 +90,7 @@ export const FeatureFlags: GraphQLFieldConfig = { args: { sortBy: { description: "The sort order of the results", - defaultValue: "NAME", + defaultValue: "name", type: new GraphQLEnumType({ name: "FeatureFlagsSortBy", values: { diff --git a/src/schema/v2/artist/insights.ts b/src/schema/v2/artist/insights.ts index 7bf27fa5aa..8eb53d2c55 100644 --- a/src/schema/v2/artist/insights.ts +++ b/src/schema/v2/artist/insights.ts @@ -7,8 +7,6 @@ import { GraphQLObjectType, GraphQLString, } from "graphql" -import { formatMarkdownValue } from "schema/v2/fields/markdown" -import Format from "schema/v2/input_fields/format" import { ResolverContext } from "types/graphql" import { ArtistType } from "../artist" import { @@ -16,6 +14,8 @@ import { getArtistInsights, getAuctionRecord, } from "./helpers" +import { formatMarkdownValue } from "schema/v2/fields/markdown" +import Format, { FORMATS } from "schema/v2/input_fields/format" export const ArtistInsightKind = new GraphQLEnumType({ name: "ArtistInsightKind", @@ -41,7 +41,7 @@ export const ArtistInsight = new GraphQLObjectType({ args: { format: { ...Format, - defaultValue: "PLAIN", + defaultValue: FORMATS.PLAIN.value, }, }, resolve: ({ description }, { format }) => { diff --git a/src/schema/v2/auction_result.ts b/src/schema/v2/auction_result.ts index 6885a996db..84aec43647 100644 --- a/src/schema/v2/auction_result.ts +++ b/src/schema/v2/auction_result.ts @@ -54,24 +54,22 @@ export const AuctionResultSorts = { }), } -const AuctionResultSortsEnums = new GraphQLEnumType({ - name: "AuctionResultsState", - values: { - ALL: { - value: "all", - }, - PAST: { - value: "past", - }, - UPCOMING: { - value: "upcoming", - }, - }, -}) - export const AuctionResultsState: GraphQLArgumentConfig = { - type: AuctionResultSortsEnums, - defaultValue: "ALL", + type: new GraphQLEnumType({ + name: "AuctionResultsState", + values: { + ALL: { + value: "all", + }, + PAST: { + value: "past", + }, + UPCOMING: { + value: "upcoming", + }, + }, + }), + defaultValue: "all", description: "State of the returned auction results (can be past, upcoming, or all)", } diff --git a/src/schema/v2/fair.ts b/src/schema/v2/fair.ts index 0a358b2de2..85a2984dfb 100644 --- a/src/schema/v2/fair.ts +++ b/src/schema/v2/fair.ts @@ -145,7 +145,7 @@ export const FairType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: "LONG", + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/me/collection.ts b/src/schema/v2/me/collection.ts index 26b959f5fa..ef6a0c15df 100644 --- a/src/schema/v2/me/collection.ts +++ b/src/schema/v2/me/collection.ts @@ -28,7 +28,8 @@ export const CollectionType = new GraphQLObjectType({ ...pageable({ sort: { type: CollectionArtworkSorts, - defaultValue: "SAVED_AT_DESC", + defaultValue: CollectionArtworkSorts.getValue("SAVED_AT_DESC")! + .value, }, page: { type: GraphQLInt }, }), diff --git a/src/schema/v2/me/savedArtworks.ts b/src/schema/v2/me/savedArtworks.ts index 0195b2d9fa..a8fede1786 100644 --- a/src/schema/v2/me/savedArtworks.ts +++ b/src/schema/v2/me/savedArtworks.ts @@ -48,7 +48,7 @@ export const SavedArtworks: GraphQLFieldConfig = { }, sort: { type: CollectionArtworkSorts, - defaultValue: "POSITION_DESC", + defaultValue: "-position", }, page: { type: GraphQLInt }, size: { type: GraphQLInt }, diff --git a/src/schema/v2/me/showsByFollowedArtists.ts b/src/schema/v2/me/showsByFollowedArtists.ts index 47b391be88..2cc601bf71 100644 --- a/src/schema/v2/me/showsByFollowedArtists.ts +++ b/src/schema/v2/me/showsByFollowedArtists.ts @@ -14,11 +14,11 @@ export const ShowsByFollowedArtists: GraphQLFieldConfig< args: pageable({ sort: { type: ShowSorts, - defaultValue: "CREATED_AT_DESC", + defaultValue: "-created_at", }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: "current", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/me/showsConnection.ts b/src/schema/v2/me/showsConnection.ts index 4a50fc3e8c..cc8c050f35 100644 --- a/src/schema/v2/me/showsConnection.ts +++ b/src/schema/v2/me/showsConnection.ts @@ -28,11 +28,11 @@ export const ShowsConnection: GraphQLFieldConfig = { }, sort: { type: ShowSorts, - defaultValue: "CREATED_AT_DESC", + defaultValue: "-created_at", }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: "current", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/partner/partner.ts b/src/schema/v2/partner/partner.ts index 9fbc40a3c4..f5c52d26d3 100644 --- a/src/schema/v2/partner/partner.ts +++ b/src/schema/v2/partner/partner.ts @@ -776,7 +776,7 @@ export const PartnerType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: "current", description: "Filter shows by chronological event status", }, isDisplayable: { diff --git a/src/schema/v2/show.ts b/src/schema/v2/show.ts index fc8135aa8f..08b6dad47b 100644 --- a/src/schema/v2/show.ts +++ b/src/schema/v2/show.ts @@ -343,7 +343,7 @@ export const ShowType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: "LONG", + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/show_event.ts b/src/schema/v2/show_event.ts index c590695412..0c39252ce6 100644 --- a/src/schema/v2/show_event.ts +++ b/src/schema/v2/show_event.ts @@ -36,7 +36,7 @@ const ShowEventType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: "LONG", + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/sorts/show_sorts.ts b/src/schema/v2/sorts/show_sorts.ts index 49b1677783..e9b3a12a19 100644 --- a/src/schema/v2/sorts/show_sorts.ts +++ b/src/schema/v2/sorts/show_sorts.ts @@ -1,7 +1,6 @@ import { GraphQLEnumType } from "graphql" const SHOW_SORTS = { - CREATED_AT_DESC: { value: "-created_at" }, END_AT_ASC: { value: "end_at" }, END_AT_DESC: { value: "-end_at" }, FEATURED_ASC: { value: "featured" }, From 1ba69fced5517558f3eb6a7e7f1589816d7b4521 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Thu, 16 Nov 2023 18:05:40 +0100 Subject: [PATCH 11/26] fix: broken enums --- _schemaV2.graphql | 53 ++++++++------- src/schema/v2/Feature/FeatureType.ts | 25 ++++--- src/schema/v2/Match.ts | 18 +----- src/schema/v2/admin/featureFlags.ts | 14 +++- src/schema/v2/artist/insights.ts | 6 +- src/schema/v2/auction_result.ts | 2 +- src/schema/v2/city/index.ts | 32 ++++----- src/schema/v2/conversation/conversations.ts | 12 ++-- src/schema/v2/fair.ts | 63 +++++++++--------- src/schema/v2/input_fields/event_status.ts | 10 +-- src/schema/v2/me/collection.ts | 9 ++- src/schema/v2/me/savedArtworks.ts | 18 +++--- src/schema/v2/me/showsByFollowedArtists.ts | 8 +-- src/schema/v2/me/showsConnection.ts | 4 +- src/schema/v2/partner/partner.ts | 60 ++++++++--------- src/schema/v2/show.ts | 72 ++++++++++----------- src/schema/v2/show_event.ts | 2 +- src/schema/v2/sorts/show_sorts.ts | 1 + 18 files changed, 208 insertions(+), 201 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 6eb070a742..7a3d95bf9b 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -147,7 +147,7 @@ type Admin { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -167,7 +167,7 @@ type AdminCreateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -182,7 +182,7 @@ type AdminDeleteFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] success: Boolean } @@ -205,7 +205,7 @@ type AdminToggleFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] success: Boolean } @@ -224,7 +224,7 @@ type AdminUpdateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -1531,7 +1531,7 @@ type Artist implements EntityWithFilterArtworksConnectionInterface & Node & Sear sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection # In applicable contexts, this is what the artist (as a suggestion) is based on. @@ -1888,7 +1888,7 @@ type ArtistInsight { # Number of entities relevant to the insight. count: Int! - description(format: Format): String + description(format: Format = PLAIN): String # List of entities relevant to the insight. entities: [String!]! @@ -3888,7 +3888,7 @@ type Collection { first: Int last: Int page: Int - sort: CollectionArtworkSorts + sort: CollectionArtworkSorts = SAVED_AT_DESC ): ArtworkConnection # Number of artworks associated with this collection. @@ -9276,7 +9276,7 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String # The exhibitors with booths in this fair with letter. @@ -9557,7 +9557,7 @@ type Feature { before: String first: Int last: Int - sort: OrderedSetSorts + sort: OrderedSetSorts = KEY_ASC ): OrderedSetConnection # A slug ID. @@ -10139,7 +10139,7 @@ type FollowsAndSaves { page: Int private: Boolean = false size: Int - sort: CollectionArtworkSorts + sort: CollectionArtworkSorts = POSITION_DESC ): SavedArtworksConnection # A list of published artworks by followed artists (grouped by date and artists). @@ -11811,7 +11811,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection auctionsLotStandingConnection( after: String @@ -12066,7 +12066,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection myCollectionConnection( after: String @@ -12239,10 +12239,10 @@ type Me implements Node { before: String first: Int last: Int - sort: ShowSorts + sort: ShowSorts = CREATED_AT_DESC # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # A list of shows for the user (pagination logic might be broken) @@ -12260,10 +12260,10 @@ type Me implements Node { # Include shows within a radius of the provided location near: Near - sort: ShowSorts + sort: ShowSorts = CREATED_AT_DESC # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # A list of artworks similar to recently viewed artworks. @@ -14017,7 +14017,7 @@ type Partner implements Node { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection showsSearchConnection( after: String @@ -15709,9 +15709,12 @@ type Query { # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported entities: [SearchEntity!] = [ - ARTICLE ARTIST + ARTIST_SERIES ARTWORK + ARTICLE + CITY + COLLECTION FAIR FEATURE GALLERY @@ -15722,6 +15725,7 @@ type Query { SALE SHOW TAG + VIEWING_ROOM ] first: Int last: Int @@ -17546,7 +17550,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String # If the show is in a Fair, then that fair @@ -17798,7 +17802,7 @@ type ShowEventType { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String startAt( format: String @@ -17844,6 +17848,7 @@ type ShowOpenedNotificationItem { } enum ShowSorts { + CREATED_AT_DESC END_AT_ASC END_AT_DESC FEATURED_ASC @@ -20367,9 +20372,12 @@ type Viewer { # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported entities: [SearchEntity!] = [ - ARTICLE ARTIST + ARTIST_SERIES ARTWORK + ARTICLE + CITY + COLLECTION FAIR FEATURE GALLERY @@ -20380,6 +20388,7 @@ type Viewer { SALE SHOW TAG + VIEWING_ROOM ] first: Int last: Int diff --git a/src/schema/v2/Feature/FeatureType.ts b/src/schema/v2/Feature/FeatureType.ts index 3adba53790..49079bd939 100644 --- a/src/schema/v2/Feature/FeatureType.ts +++ b/src/schema/v2/Feature/FeatureType.ts @@ -1,25 +1,22 @@ import { - GraphQLString, + GraphQLBoolean, GraphQLNonNull, GraphQLObjectType, - GraphQLBoolean, + GraphQLString, } from "graphql" -import { Array } from "runtypes" -import { pageable } from "relay-cursor-paging" import { connectionFromArraySlice } from "graphql-relay" -import { Gravity } from "types/runtime" -import { ResolverContext } from "types/graphql" -import { SlugAndInternalIDFields } from "schema/v2/object_identification" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import { pageable } from "relay-cursor-paging" +import { Array } from "runtypes" import { markdown } from "schema/v2/fields/markdown" +import { SlugAndInternalIDFields } from "schema/v2/object_identification" +import { ResolverContext } from "types/graphql" +import { Gravity } from "types/runtime" import { OrderedSetConnection } from "../OrderedSet" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { - OrderedSetSortsEnum, - ORDERED_SET_SORTS, -} from "../OrderedSet/OrderedSetSortsEnum" +import { OrderedSetSortsEnum } from "../OrderedSet/OrderedSetSortsEnum" import Image from "../image" -import { FeatureMetaType } from "./FeatureMeta" import { FeatureLayoutsEnum } from "./FeatureLayoutsEnum" +import { FeatureMetaType } from "./FeatureMeta" export const FeatureType = new GraphQLObjectType< Gravity.Feature, @@ -52,7 +49,7 @@ export const FeatureType = new GraphQLObjectType< args: pageable({ sort: { type: OrderedSetSortsEnum, - defaultValue: ORDERED_SET_SORTS.KEY_ASC.value, + defaultValue: "KEY_ASC", }, }), description: diff --git a/src/schema/v2/Match.ts b/src/schema/v2/Match.ts index 548db5dac8..cd003c0cb2 100644 --- a/src/schema/v2/Match.ts +++ b/src/schema/v2/Match.ts @@ -59,21 +59,9 @@ export const MatchConnection: GraphQLFieldConfig = { type: new GraphQLList(new GraphQLNonNull(SearchEntity)), description: "ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported", - defaultValue: [ - "ARTICLE", - "ARTIST", - "ARTWORK", - "FAIR", - "FEATURE", - "GALLERY", - "GENE", - "INSTITUTION", - "PAGE", - "PROFILE", - "SALE", - "SHOW", - "TAG", - ], + defaultValue: SearchEntity.getValues().map( + (searchEntity) => searchEntity.name + ), }, mode: { type: SearchMode, diff --git a/src/schema/v2/admin/featureFlags.ts b/src/schema/v2/admin/featureFlags.ts index e3033106e3..50571645b1 100644 --- a/src/schema/v2/admin/featureFlags.ts +++ b/src/schema/v2/admin/featureFlags.ts @@ -84,13 +84,25 @@ export const FeatureFlagType = new GraphQLObjectType({ }, }) +const FeatureFlagsSortsEnums = new GraphQLEnumType({ + name: "FeatureFlagsSortBy", + values: { + NAME: { + value: "name", + }, + CREATED_AT: { + value: "createdAt", + }, + }, +}) + export const FeatureFlags: GraphQLFieldConfig = { type: new GraphQLList(FeatureFlagType), description: "A list of feature flags", args: { sortBy: { description: "The sort order of the results", - defaultValue: "name", + defaultValue: FeatureFlagsSortsEnums.getValue("NAME")?.name, type: new GraphQLEnumType({ name: "FeatureFlagsSortBy", values: { diff --git a/src/schema/v2/artist/insights.ts b/src/schema/v2/artist/insights.ts index 8eb53d2c55..7bf27fa5aa 100644 --- a/src/schema/v2/artist/insights.ts +++ b/src/schema/v2/artist/insights.ts @@ -7,6 +7,8 @@ import { GraphQLObjectType, GraphQLString, } from "graphql" +import { formatMarkdownValue } from "schema/v2/fields/markdown" +import Format from "schema/v2/input_fields/format" import { ResolverContext } from "types/graphql" import { ArtistType } from "../artist" import { @@ -14,8 +16,6 @@ import { getArtistInsights, getAuctionRecord, } from "./helpers" -import { formatMarkdownValue } from "schema/v2/fields/markdown" -import Format, { FORMATS } from "schema/v2/input_fields/format" export const ArtistInsightKind = new GraphQLEnumType({ name: "ArtistInsightKind", @@ -41,7 +41,7 @@ export const ArtistInsight = new GraphQLObjectType({ args: { format: { ...Format, - defaultValue: FORMATS.PLAIN.value, + defaultValue: "PLAIN", }, }, resolve: ({ description }, { format }) => { diff --git a/src/schema/v2/auction_result.ts b/src/schema/v2/auction_result.ts index 84aec43647..4abbaa73cc 100644 --- a/src/schema/v2/auction_result.ts +++ b/src/schema/v2/auction_result.ts @@ -69,7 +69,7 @@ export const AuctionResultsState: GraphQLArgumentConfig = { }, }, }), - defaultValue: "all", + defaultValue: "ALL", description: "State of the returned auction results (can be past, upcoming, or all)", } diff --git a/src/schema/v2/city/index.ts b/src/schema/v2/city/index.ts index 55a7847fc4..54e978dccd 100644 --- a/src/schema/v2/city/index.ts +++ b/src/schema/v2/city/index.ts @@ -4,30 +4,30 @@ import { GraphQLFieldConfig, GraphQLInt, GraphQLList, + GraphQLNonNull, GraphQLObjectType, GraphQLString, - GraphQLNonNull, } from "graphql" -import { LatLngType } from "../location" -import ShowSorts from "schema/v2/sorts/show_sorts" -import FairSorts from "schema/v2/sorts/fair_sorts" -import EventStatus from "schema/v2/input_fields/event_status" -import { pageable, CursorPageable } from "relay-cursor-paging" import { connectionFromArraySlice } from "graphql-relay" -import { - LOCAL_DISCOVERY_RADIUS_KM, - NEAREST_CITY_THRESHOLD_KM, -} from "./constants" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import Near from "schema/v2/input_fields/near" +import { HTTPError } from "lib/HTTPError" +import { MAX_GRAPHQL_INT, allViaLoader } from "lib/all" import { LatLng, distance } from "lib/geospatial" -import { ResolverContext } from "types/graphql" -import { allViaLoader, MAX_GRAPHQL_INT } from "lib/all" -import { StaticPathLoader } from "lib/loaders/api/loader_interface" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { BodyAndHeaders } from "lib/loaders" +import { StaticPathLoader } from "lib/loaders/api/loader_interface" import { sponsoredContentForCity } from "lib/sponsoredContent" +import { CursorPageable, pageable } from "relay-cursor-paging" +import EventStatus from "schema/v2/input_fields/event_status" +import Near from "schema/v2/input_fields/near" +import FairSorts from "schema/v2/sorts/fair_sorts" +import ShowSorts from "schema/v2/sorts/show_sorts" +import { ResolverContext } from "types/graphql" import { createPageCursors } from "../fields/pagination" -import { HTTPError } from "lib/HTTPError" +import { LatLngType } from "../location" +import { + LOCAL_DISCOVERY_RADIUS_KM, + NEAREST_CITY_THRESHOLD_KM, +} from "./constants" export interface TCity { slug: string diff --git a/src/schema/v2/conversation/conversations.ts b/src/schema/v2/conversation/conversations.ts index 429b018e87..f6d5adb7b2 100644 --- a/src/schema/v2/conversation/conversations.ts +++ b/src/schema/v2/conversation/conversations.ts @@ -1,17 +1,17 @@ -import { CursorPageable, pageable } from "relay-cursor-paging" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { - GraphQLInt, + GraphQLBoolean, GraphQLFieldConfig, + GraphQLInt, GraphQLString, - GraphQLBoolean, } from "graphql" -import { connectionFromArraySlice, connectionDefinitions } from "graphql-relay" +import { connectionDefinitions, connectionFromArraySlice } from "graphql-relay" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { assign } from "lodash" +import { CursorPageable, pageable } from "relay-cursor-paging" +import { GraphQLEnumType } from "graphql" import { ConversationType } from "schema/v2/conversation" import { ResolverContext } from "types/graphql" -import { GraphQLEnumType } from "graphql" interface ConversationsArguments extends CursorPageable { dismissed?: boolean diff --git a/src/schema/v2/fair.ts b/src/schema/v2/fair.ts index 85a2984dfb..b72c13c707 100644 --- a/src/schema/v2/fair.ts +++ b/src/schema/v2/fair.ts @@ -1,47 +1,46 @@ -import { omit, map, deburr } from "lodash" -import { pageable } from "relay-cursor-paging" -import { connectionFromArraySlice } from "graphql-relay" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { dateRange, formattedOpeningHours } from "lib/date" -import { artistConnection } from "./artist" -import moment from "moment" -import cached from "./fields/cached" -import date from "./fields/date" -import numeral from "./fields/numeral" -import Profile from "./profile" -import Image from "./image" -import Artist from "./artist" -import Partner, { PartnerType } from "schema/v2/partner/partner" -import { ShowsConnection } from "./show" -import { LocationType } from "./location" -import { - SlugAndInternalIDFields, - SlugIDField, - NodeInterface, -} from "./object_identification" import { - GraphQLObjectType, - GraphQLString, GraphQLBoolean, - GraphQLNonNull, - GraphQLList, GraphQLFieldConfig, GraphQLInt, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLString, } from "graphql" -import ShowSorts from "./sorts/show_sorts" +import { connectionFromArraySlice } from "graphql-relay" import { allViaLoader } from "lib/all" -import { FairArtistSortsType } from "./sorts/fairArtistSorts" -import { ResolverContext } from "types/graphql" +import { dateRange, formattedOpeningHours } from "lib/date" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { sponsoredContentForFair } from "lib/sponsoredContent" -import { markdown } from "./fields/markdown" -import { articleConnection } from "./article" -import ArticleSorts from "./sorts/article_sorts" +import { deburr, map, omit } from "lodash" +import moment from "moment" +import { pageable } from "relay-cursor-paging" import { connectionWithCursorInfo, createPageCursors, paginationResolver, } from "schema/v2/fields/pagination" +import Partner, { PartnerType } from "schema/v2/partner/partner" +import { ResolverContext } from "types/graphql" +import { articleConnection } from "./article" +import Artist, { artistConnection } from "./artist" import { FairOrganizerType } from "./fair_organizer" +import cached from "./fields/cached" +import date from "./fields/date" +import { markdown } from "./fields/markdown" +import numeral from "./fields/numeral" +import Image from "./image" +import { LocationType } from "./location" +import { + NodeInterface, + SlugAndInternalIDFields, + SlugIDField, +} from "./object_identification" +import Profile from "./profile" +import { ShowsConnection } from "./show" +import ArticleSorts from "./sorts/article_sorts" +import { FairArtistSortsType } from "./sorts/fairArtistSorts" +import ShowSorts from "./sorts/show_sorts" import { ExhibitionPeriodFormatEnum } from "./types/exhibitonPeriod" const FollowedContentType = new GraphQLObjectType({ @@ -145,7 +144,7 @@ export const FairType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: "LONG", }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/input_fields/event_status.ts b/src/schema/v2/input_fields/event_status.ts index fc54cf832f..d986a8eb29 100644 --- a/src/schema/v2/input_fields/event_status.ts +++ b/src/schema/v2/input_fields/event_status.ts @@ -26,11 +26,13 @@ const EVENT_STATUS_SORTS = { }, } as const +export const EVENT_STATUS_SORTS_ENUMS = new GraphQLEnumType({ + name: "EventStatus", + values: EVENT_STATUS_SORTS, +}) + export const EventStatus = { - type: new GraphQLEnumType({ - name: "EventStatus", - values: EVENT_STATUS_SORTS, - }), + type: EVENT_STATUS_SORTS_ENUMS, } export type EventStatusType = keyof typeof EVENT_STATUS_SORTS diff --git a/src/schema/v2/me/collection.ts b/src/schema/v2/me/collection.ts index ef6a0c15df..797c1369ec 100644 --- a/src/schema/v2/me/collection.ts +++ b/src/schema/v2/me/collection.ts @@ -1,10 +1,10 @@ import { + GraphQLBoolean, GraphQLFieldConfig, - GraphQLObjectType, + GraphQLInt, GraphQLNonNull, + GraphQLObjectType, GraphQLString, - GraphQLBoolean, - GraphQLInt, } from "graphql" import { CatchCollectionNotFoundException, @@ -28,8 +28,7 @@ export const CollectionType = new GraphQLObjectType({ ...pageable({ sort: { type: CollectionArtworkSorts, - defaultValue: CollectionArtworkSorts.getValue("SAVED_AT_DESC")! - .value, + defaultValue: "SAVED_AT_DESC", }, page: { type: GraphQLInt }, }), diff --git a/src/schema/v2/me/savedArtworks.ts b/src/schema/v2/me/savedArtworks.ts index a8fede1786..fd93c1b95e 100644 --- a/src/schema/v2/me/savedArtworks.ts +++ b/src/schema/v2/me/savedArtworks.ts @@ -1,22 +1,22 @@ import { + GraphQLBoolean, GraphQLFieldConfig, + GraphQLInt, GraphQLNonNull, GraphQLString, - GraphQLBoolean, - GraphQLInt, } from "graphql" +import { + CatchCollectionNotFoundException, + convertConnectionArgsToGravityArgs, +} from "lib/helpers" +import { pageable } from "relay-cursor-paging" import { ResolverContext } from "types/graphql" +import { ArtworkType } from "../artwork" import { connectionWithCursorInfo, paginationResolver, } from "../fields/pagination" -import { ArtworkType } from "../artwork" -import { pageable } from "relay-cursor-paging" import CollectionArtworkSorts from "../sorts/collection_sorts" -import { - CatchCollectionNotFoundException, - convertConnectionArgsToGravityArgs, -} from "lib/helpers" export const COLLECTION_ID = "saved-artwork" @@ -48,7 +48,7 @@ export const SavedArtworks: GraphQLFieldConfig = { }, sort: { type: CollectionArtworkSorts, - defaultValue: "-position", + defaultValue: "POSITION_DESC", }, page: { type: GraphQLInt }, size: { type: GraphQLInt }, diff --git a/src/schema/v2/me/showsByFollowedArtists.ts b/src/schema/v2/me/showsByFollowedArtists.ts index 2cc601bf71..bbe041206f 100644 --- a/src/schema/v2/me/showsByFollowedArtists.ts +++ b/src/schema/v2/me/showsByFollowedArtists.ts @@ -1,10 +1,10 @@ import { GraphQLFieldConfig } from "graphql" +import { connectionFromArraySlice } from "graphql-relay" import { getPagingParameters, pageable } from "relay-cursor-paging" import { ResolverContext } from "types/graphql" -import { connectionFromArraySlice } from "graphql-relay" import EventStatus from "../input_fields/event_status" -import ShowSorts from "../sorts/show_sorts" import { ShowsConnection } from "../show" +import ShowSorts from "../sorts/show_sorts" export const ShowsByFollowedArtists: GraphQLFieldConfig< void, @@ -14,11 +14,11 @@ export const ShowsByFollowedArtists: GraphQLFieldConfig< args: pageable({ sort: { type: ShowSorts, - defaultValue: "-created_at", + defaultValue: "CREATED_AT_DESC", }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: "CURRENT", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/me/showsConnection.ts b/src/schema/v2/me/showsConnection.ts index cc8c050f35..4a50fc3e8c 100644 --- a/src/schema/v2/me/showsConnection.ts +++ b/src/schema/v2/me/showsConnection.ts @@ -28,11 +28,11 @@ export const ShowsConnection: GraphQLFieldConfig = { }, sort: { type: ShowSorts, - defaultValue: "-created_at", + defaultValue: "CREATED_AT_DESC", }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: "CURRENT", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/partner/partner.ts b/src/schema/v2/partner/partner.ts index f5c52d26d3..3765ba0d30 100644 --- a/src/schema/v2/partner/partner.ts +++ b/src/schema/v2/partner/partner.ts @@ -1,53 +1,53 @@ -import { CursorPageable, pageable } from "relay-cursor-paging" import { - GraphQLString, - GraphQLObjectType, - GraphQLNonNull, - GraphQLInt, - GraphQLList, GraphQLBoolean, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, + GraphQLInt, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLString, } from "graphql" import { connectionFromArraySlice } from "graphql-relay" -import { flatten } from "lodash" +import { allViaLoader } from "lib/all" +import { deprecate } from "lib/deprecation" +import { includesFieldsOtherThanSelectionSet } from "lib/hasFieldSelection" import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import { flatten } from "lodash" +import { CursorPageable, pageable } from "relay-cursor-paging" +import { articleConnection } from "schema/v2/article" +import { ArtistType } from "schema/v2/artist" +import { artworkConnection } from "schema/v2/artwork" import cached from "schema/v2/fields/cached" import initials from "schema/v2/fields/initials" -import Profile from "schema/v2/profile" -import { locationsConnection, LocationType } from "schema/v2/location" +import numeral from "schema/v2/fields/numeral" +import { + connectionWithCursorInfo, + createPageCursors, + paginationResolver, +} from "schema/v2/fields/pagination" import EventStatus from "schema/v2/input_fields/event_status" +import { LocationType, locationsConnection } from "schema/v2/location" import { NodeInterface, SlugAndInternalIDFields, } from "schema/v2/object_identification" -import { artworkConnection } from "schema/v2/artwork" -import numeral from "schema/v2/fields/numeral" -import { ShowsConnection, ShowType } from "schema/v2/show" -import { ArtistType } from "schema/v2/artist" +import Profile from "schema/v2/profile" +import { ShowType, ShowsConnection } from "schema/v2/show" +import ArticleSorts, { ArticleSort } from "schema/v2/sorts/article_sorts" +import ArtistSorts from "schema/v2/sorts/artist_sorts" import ArtworkSorts from "schema/v2/sorts/artwork_sorts" -import { includesFieldsOtherThanSelectionSet } from "lib/hasFieldSelection" -import { ResolverContext } from "types/graphql" -import { PartnerCategoryType } from "./partner_category" import ShowSorts from "schema/v2/sorts/show_sorts" -import ArtistSorts from "schema/v2/sorts/artist_sorts" +import { ResolverContext } from "types/graphql" import { fields as partnerArtistFields } from "./partner_artist" -import { - connectionWithCursorInfo, - createPageCursors, - paginationResolver, -} from "schema/v2/fields/pagination" -import { deprecate } from "lib/deprecation" -import { articleConnection } from "schema/v2/article" -import ArticleSorts, { ArticleSort } from "schema/v2/sorts/article_sorts" -import { allViaLoader } from "lib/all" +import { PartnerCategoryType } from "./partner_category" import { truncate } from "lib/helpers" -import { setVersion } from "schema/v2/image/normalize" import { compact } from "lodash" -import { InquiryRequestType } from "./partnerInquiryRequest" -import { PartnerDocumentsConnection } from "./partnerDocumentsConnection" +import { setVersion } from "schema/v2/image/normalize" import { AlertsSummaryFields } from "../alerts" +import { PartnerDocumentsConnection } from "./partnerDocumentsConnection" +import { InquiryRequestType } from "./partnerInquiryRequest" const isFairOrganizer = (type) => type === "FairOrganizer" const isGallery = (type) => type === "PartnerGallery" @@ -776,7 +776,7 @@ export const PartnerType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: "CURRENT", description: "Filter shows by chronological event status", }, isDisplayable: { diff --git a/src/schema/v2/show.ts b/src/schema/v2/show.ts index 08b6dad47b..23ea674298 100644 --- a/src/schema/v2/show.ts +++ b/src/schema/v2/show.ts @@ -1,51 +1,51 @@ -import moment from "moment" -import { pageable } from "relay-cursor-paging" import { - connectionFromArraySlice, - connectionFromArray, - connectionDefinitions, + GraphQLBoolean, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, + GraphQLInt, + GraphQLList, + GraphQLNonNull, + GraphQLObjectType, + GraphQLString, + GraphQLUnionType, +} from "graphql" +import { Connection, + connectionDefinitions, + connectionFromArray, + connectionFromArraySlice, } from "graphql-relay" +import { HTTPError } from "lib/HTTPError" +import { dateRange, exhibitionStatus } from "lib/date" import { - isExisty, - existyValue, convertConnectionArgsToGravityArgs, + existyValue, + isExisty, } from "lib/helpers" -import { HTTPError } from "lib/HTTPError" -import numeral from "./fields/numeral" -import { dateRange, exhibitionStatus } from "lib/date" -import cached from "./fields/cached" -import date from "./fields/date" -import { markdown } from "./fields/markdown" -import Artist from "./artist" +import { totalViaLoader } from "lib/total" +import { find, flatten } from "lodash" +import moment from "moment" +import { pageable } from "relay-cursor-paging" +import { connectionWithCursorInfo } from "schema/v2/fields/pagination" import { PartnerType } from "schema/v2/partner/partner" +import Artist from "./artist" +import { artworkConnection } from "./artwork" import { ExternalPartnerType } from "./external_partner" import Fair from "./fair" -import { artworkConnection } from "./artwork" -import { LocationType } from "./location" +import cached from "./fields/cached" +import date from "./fields/date" +import { markdown } from "./fields/markdown" +import numeral from "./fields/numeral" import Image, { getDefault, normalizeImageData } from "./image" -import ShowEventType from "./show_event" -import { connectionWithCursorInfo } from "schema/v2/fields/pagination" +import { LocationType } from "./location" import { NodeInterface, SlugAndInternalIDFields } from "./object_identification" -import { - GraphQLObjectType, - GraphQLString, - GraphQLNonNull, - GraphQLList, - GraphQLInt, - GraphQLBoolean, - GraphQLUnionType, - GraphQLFieldConfig, - GraphQLFieldConfigArgumentMap, -} from "graphql" -import { totalViaLoader } from "lib/total" -import { find, flatten } from "lodash" +import ShowEventType from "./show_event" -import ShowSorts from "./sorts/show_sorts" -import EventStatus from "./input_fields/event_status" -import { LOCAL_DISCOVERY_RADIUS_KM } from "./city/constants" -import { ResolverContext } from "types/graphql" import followArtistsResolver from "lib/shared_resolvers/followedArtistsResolver" +import { ResolverContext } from "types/graphql" +import { LOCAL_DISCOVERY_RADIUS_KM } from "./city/constants" +import EventStatus from "./input_fields/event_status" +import ShowSorts from "./sorts/show_sorts" import { ExhibitionPeriodFormatEnum } from "./types/exhibitonPeriod" const FollowArtistType = new GraphQLObjectType({ @@ -343,7 +343,7 @@ export const ShowType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: "LONG", }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/show_event.ts b/src/schema/v2/show_event.ts index 0c39252ce6..c590695412 100644 --- a/src/schema/v2/show_event.ts +++ b/src/schema/v2/show_event.ts @@ -36,7 +36,7 @@ const ShowEventType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: "LONG", }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/sorts/show_sorts.ts b/src/schema/v2/sorts/show_sorts.ts index e9b3a12a19..49b1677783 100644 --- a/src/schema/v2/sorts/show_sorts.ts +++ b/src/schema/v2/sorts/show_sorts.ts @@ -1,6 +1,7 @@ import { GraphQLEnumType } from "graphql" const SHOW_SORTS = { + CREATED_AT_DESC: { value: "-created_at" }, END_AT_ASC: { value: "end_at" }, END_AT_DESC: { value: "-end_at" }, FEATURED_ASC: { value: "featured" }, From 4f2180842cf55a0aa45686d7156d308e6b67a206 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 10:58:29 +0100 Subject: [PATCH 12/26] chore: upgrade graphql-tools to 4.0.8 --- package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 993fad805e..be3adf55e1 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "graphql-middleware": "6.1.32", "graphql-parse-resolve-info": "^4.12.3", "graphql-relay": "0.7.0", - "graphql-tools": "4.0.7", + "graphql-tools": "4.0.8", "graphql-type-json": "0.1.4", "graphql-upload": "^13.0.0", "hot-shots": "5.6.1", diff --git a/yarn.lock b/yarn.lock index 55d6bd8f86..9378fd893a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2618,7 +2618,7 @@ apollo-link-http@^1.5.17: apollo-link-http-common "^0.2.16" tslib "^1.9.3" -apollo-link@^1.2.14, apollo-link@^1.2.3: +apollo-link@^1.2.14: version "1.2.14" resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== @@ -5092,12 +5092,12 @@ graphql-relay@0.7.0: resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.7.0.tgz#e5c7a4bb52ede09e90e92dfd7b89d5947362278b" integrity sha512-P8eS3IbZRhbfbcfud1Q6VPrIru4hchkb15MuOij+WQo9r0chD5NBIxiVjuRE2iG2EMHxIOrZb8LnMe82+YdITA== -graphql-tools@4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.7.tgz#743309b96cb657ff45b607ee0a07193cd987e43c" - integrity sha512-rApl8sT8t/W1uQRcwzxMYyUBiCl/XicluApiDkNze5TX/GR0BSTQMjM2UcRGdTmkbsb1Eqq6afkyyeG/zMxZYQ== +graphql-tools@4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.8.tgz#e7fb9f0d43408fb0878ba66b522ce871bafe9d30" + integrity sha512-MW+ioleBrwhRjalKjYaLQbr+920pHBgy9vM/n47sswtns8+96sRn5M/G+J1eu7IMeKWiN/9p6tmwCHU7552VJg== dependencies: - apollo-link "^1.2.3" + apollo-link "^1.2.14" apollo-utilities "^1.0.1" deprecated-decorator "^0.1.6" iterall "^1.1.3" From f5080c975d9e2997c00b09ae6f680fed72425948 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 11:28:05 +0100 Subject: [PATCH 13/26] Revert "fix: broken enums" This reverts commit 2333c383ad81b08e99e00f1ff74c17c4ec0dc853. --- _schemaV2.graphql | 53 +++++++-------- src/schema/v2/Feature/FeatureType.ts | 25 +++---- src/schema/v2/Match.ts | 18 +++++- src/schema/v2/admin/featureFlags.ts | 14 +--- src/schema/v2/artist/insights.ts | 6 +- src/schema/v2/auction_result.ts | 2 +- src/schema/v2/city/index.ts | 32 ++++----- src/schema/v2/conversation/conversations.ts | 12 ++-- src/schema/v2/fair.ts | 63 +++++++++--------- src/schema/v2/input_fields/event_status.ts | 10 ++- src/schema/v2/me/collection.ts | 9 +-- src/schema/v2/me/savedArtworks.ts | 18 +++--- src/schema/v2/me/showsByFollowedArtists.ts | 8 +-- src/schema/v2/me/showsConnection.ts | 4 +- src/schema/v2/partner/partner.ts | 60 ++++++++--------- src/schema/v2/show.ts | 72 ++++++++++----------- src/schema/v2/show_event.ts | 2 +- src/schema/v2/sorts/show_sorts.ts | 1 - 18 files changed, 201 insertions(+), 208 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 7a3d95bf9b..6eb070a742 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -147,7 +147,7 @@ type Admin { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] } @@ -167,7 +167,7 @@ type AdminCreateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] } @@ -182,7 +182,7 @@ type AdminDeleteFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] success: Boolean } @@ -205,7 +205,7 @@ type AdminToggleFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] success: Boolean } @@ -224,7 +224,7 @@ type AdminUpdateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy = NAME + sortBy: FeatureFlagsSortBy ): [FeatureFlag] } @@ -1531,7 +1531,7 @@ type Artist implements EntityWithFilterArtworksConnectionInterface & Node & Sear sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState = ALL + state: AuctionResultsState ): AuctionResultConnection # In applicable contexts, this is what the artist (as a suggestion) is based on. @@ -1888,7 +1888,7 @@ type ArtistInsight { # Number of entities relevant to the insight. count: Int! - description(format: Format = PLAIN): String + description(format: Format): String # List of entities relevant to the insight. entities: [String!]! @@ -3888,7 +3888,7 @@ type Collection { first: Int last: Int page: Int - sort: CollectionArtworkSorts = SAVED_AT_DESC + sort: CollectionArtworkSorts ): ArtworkConnection # Number of artworks associated with this collection. @@ -9276,7 +9276,7 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat = LONG + format: ExhibitionPeriodFormat ): String # The exhibitors with booths in this fair with letter. @@ -9557,7 +9557,7 @@ type Feature { before: String first: Int last: Int - sort: OrderedSetSorts = KEY_ASC + sort: OrderedSetSorts ): OrderedSetConnection # A slug ID. @@ -10139,7 +10139,7 @@ type FollowsAndSaves { page: Int private: Boolean = false size: Int - sort: CollectionArtworkSorts = POSITION_DESC + sort: CollectionArtworkSorts ): SavedArtworksConnection # A list of published artworks by followed artists (grouped by date and artists). @@ -11811,7 +11811,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState = ALL + state: AuctionResultsState ): AuctionResultConnection auctionsLotStandingConnection( after: String @@ -12066,7 +12066,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState = ALL + state: AuctionResultsState ): AuctionResultConnection myCollectionConnection( after: String @@ -12239,10 +12239,10 @@ type Me implements Node { before: String first: Int last: Int - sort: ShowSorts = CREATED_AT_DESC + sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection # A list of shows for the user (pagination logic might be broken) @@ -12260,10 +12260,10 @@ type Me implements Node { # Include shows within a radius of the provided location near: Near - sort: ShowSorts = CREATED_AT_DESC + sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection # A list of artworks similar to recently viewed artworks. @@ -14017,7 +14017,7 @@ type Partner implements Node { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection showsSearchConnection( after: String @@ -15709,12 +15709,9 @@ type Query { # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported entities: [SearchEntity!] = [ + ARTICLE ARTIST - ARTIST_SERIES ARTWORK - ARTICLE - CITY - COLLECTION FAIR FEATURE GALLERY @@ -15725,7 +15722,6 @@ type Query { SALE SHOW TAG - VIEWING_ROOM ] first: Int last: Int @@ -17550,7 +17546,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat = LONG + format: ExhibitionPeriodFormat ): String # If the show is in a Fair, then that fair @@ -17802,7 +17798,7 @@ type ShowEventType { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat = LONG + format: ExhibitionPeriodFormat ): String startAt( format: String @@ -17848,7 +17844,6 @@ type ShowOpenedNotificationItem { } enum ShowSorts { - CREATED_AT_DESC END_AT_ASC END_AT_DESC FEATURED_ASC @@ -20372,12 +20367,9 @@ type Viewer { # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported entities: [SearchEntity!] = [ + ARTICLE ARTIST - ARTIST_SERIES ARTWORK - ARTICLE - CITY - COLLECTION FAIR FEATURE GALLERY @@ -20388,7 +20380,6 @@ type Viewer { SALE SHOW TAG - VIEWING_ROOM ] first: Int last: Int diff --git a/src/schema/v2/Feature/FeatureType.ts b/src/schema/v2/Feature/FeatureType.ts index 49079bd939..3adba53790 100644 --- a/src/schema/v2/Feature/FeatureType.ts +++ b/src/schema/v2/Feature/FeatureType.ts @@ -1,22 +1,25 @@ import { - GraphQLBoolean, + GraphQLString, GraphQLNonNull, GraphQLObjectType, - GraphQLString, + GraphQLBoolean, } from "graphql" -import { connectionFromArraySlice } from "graphql-relay" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { pageable } from "relay-cursor-paging" import { Array } from "runtypes" -import { markdown } from "schema/v2/fields/markdown" -import { SlugAndInternalIDFields } from "schema/v2/object_identification" -import { ResolverContext } from "types/graphql" +import { pageable } from "relay-cursor-paging" +import { connectionFromArraySlice } from "graphql-relay" import { Gravity } from "types/runtime" +import { ResolverContext } from "types/graphql" +import { SlugAndInternalIDFields } from "schema/v2/object_identification" +import { markdown } from "schema/v2/fields/markdown" import { OrderedSetConnection } from "../OrderedSet" -import { OrderedSetSortsEnum } from "../OrderedSet/OrderedSetSortsEnum" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import { + OrderedSetSortsEnum, + ORDERED_SET_SORTS, +} from "../OrderedSet/OrderedSetSortsEnum" import Image from "../image" -import { FeatureLayoutsEnum } from "./FeatureLayoutsEnum" import { FeatureMetaType } from "./FeatureMeta" +import { FeatureLayoutsEnum } from "./FeatureLayoutsEnum" export const FeatureType = new GraphQLObjectType< Gravity.Feature, @@ -49,7 +52,7 @@ export const FeatureType = new GraphQLObjectType< args: pageable({ sort: { type: OrderedSetSortsEnum, - defaultValue: "KEY_ASC", + defaultValue: ORDERED_SET_SORTS.KEY_ASC.value, }, }), description: diff --git a/src/schema/v2/Match.ts b/src/schema/v2/Match.ts index cd003c0cb2..548db5dac8 100644 --- a/src/schema/v2/Match.ts +++ b/src/schema/v2/Match.ts @@ -59,9 +59,21 @@ export const MatchConnection: GraphQLFieldConfig = { type: new GraphQLList(new GraphQLNonNull(SearchEntity)), description: "ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported", - defaultValue: SearchEntity.getValues().map( - (searchEntity) => searchEntity.name - ), + defaultValue: [ + "ARTICLE", + "ARTIST", + "ARTWORK", + "FAIR", + "FEATURE", + "GALLERY", + "GENE", + "INSTITUTION", + "PAGE", + "PROFILE", + "SALE", + "SHOW", + "TAG", + ], }, mode: { type: SearchMode, diff --git a/src/schema/v2/admin/featureFlags.ts b/src/schema/v2/admin/featureFlags.ts index 50571645b1..e3033106e3 100644 --- a/src/schema/v2/admin/featureFlags.ts +++ b/src/schema/v2/admin/featureFlags.ts @@ -84,25 +84,13 @@ export const FeatureFlagType = new GraphQLObjectType({ }, }) -const FeatureFlagsSortsEnums = new GraphQLEnumType({ - name: "FeatureFlagsSortBy", - values: { - NAME: { - value: "name", - }, - CREATED_AT: { - value: "createdAt", - }, - }, -}) - export const FeatureFlags: GraphQLFieldConfig = { type: new GraphQLList(FeatureFlagType), description: "A list of feature flags", args: { sortBy: { description: "The sort order of the results", - defaultValue: FeatureFlagsSortsEnums.getValue("NAME")?.name, + defaultValue: "name", type: new GraphQLEnumType({ name: "FeatureFlagsSortBy", values: { diff --git a/src/schema/v2/artist/insights.ts b/src/schema/v2/artist/insights.ts index 7bf27fa5aa..8eb53d2c55 100644 --- a/src/schema/v2/artist/insights.ts +++ b/src/schema/v2/artist/insights.ts @@ -7,8 +7,6 @@ import { GraphQLObjectType, GraphQLString, } from "graphql" -import { formatMarkdownValue } from "schema/v2/fields/markdown" -import Format from "schema/v2/input_fields/format" import { ResolverContext } from "types/graphql" import { ArtistType } from "../artist" import { @@ -16,6 +14,8 @@ import { getArtistInsights, getAuctionRecord, } from "./helpers" +import { formatMarkdownValue } from "schema/v2/fields/markdown" +import Format, { FORMATS } from "schema/v2/input_fields/format" export const ArtistInsightKind = new GraphQLEnumType({ name: "ArtistInsightKind", @@ -41,7 +41,7 @@ export const ArtistInsight = new GraphQLObjectType({ args: { format: { ...Format, - defaultValue: "PLAIN", + defaultValue: FORMATS.PLAIN.value, }, }, resolve: ({ description }, { format }) => { diff --git a/src/schema/v2/auction_result.ts b/src/schema/v2/auction_result.ts index 4abbaa73cc..84aec43647 100644 --- a/src/schema/v2/auction_result.ts +++ b/src/schema/v2/auction_result.ts @@ -69,7 +69,7 @@ export const AuctionResultsState: GraphQLArgumentConfig = { }, }, }), - defaultValue: "ALL", + defaultValue: "all", description: "State of the returned auction results (can be past, upcoming, or all)", } diff --git a/src/schema/v2/city/index.ts b/src/schema/v2/city/index.ts index 54e978dccd..55a7847fc4 100644 --- a/src/schema/v2/city/index.ts +++ b/src/schema/v2/city/index.ts @@ -4,30 +4,30 @@ import { GraphQLFieldConfig, GraphQLInt, GraphQLList, - GraphQLNonNull, GraphQLObjectType, GraphQLString, + GraphQLNonNull, } from "graphql" -import { connectionFromArraySlice } from "graphql-relay" -import { HTTPError } from "lib/HTTPError" -import { MAX_GRAPHQL_INT, allViaLoader } from "lib/all" -import { LatLng, distance } from "lib/geospatial" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { BodyAndHeaders } from "lib/loaders" -import { StaticPathLoader } from "lib/loaders/api/loader_interface" -import { sponsoredContentForCity } from "lib/sponsoredContent" -import { CursorPageable, pageable } from "relay-cursor-paging" -import EventStatus from "schema/v2/input_fields/event_status" -import Near from "schema/v2/input_fields/near" -import FairSorts from "schema/v2/sorts/fair_sorts" -import ShowSorts from "schema/v2/sorts/show_sorts" -import { ResolverContext } from "types/graphql" -import { createPageCursors } from "../fields/pagination" import { LatLngType } from "../location" +import ShowSorts from "schema/v2/sorts/show_sorts" +import FairSorts from "schema/v2/sorts/fair_sorts" +import EventStatus from "schema/v2/input_fields/event_status" +import { pageable, CursorPageable } from "relay-cursor-paging" +import { connectionFromArraySlice } from "graphql-relay" import { LOCAL_DISCOVERY_RADIUS_KM, NEAREST_CITY_THRESHOLD_KM, } from "./constants" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import Near from "schema/v2/input_fields/near" +import { LatLng, distance } from "lib/geospatial" +import { ResolverContext } from "types/graphql" +import { allViaLoader, MAX_GRAPHQL_INT } from "lib/all" +import { StaticPathLoader } from "lib/loaders/api/loader_interface" +import { BodyAndHeaders } from "lib/loaders" +import { sponsoredContentForCity } from "lib/sponsoredContent" +import { createPageCursors } from "../fields/pagination" +import { HTTPError } from "lib/HTTPError" export interface TCity { slug: string diff --git a/src/schema/v2/conversation/conversations.ts b/src/schema/v2/conversation/conversations.ts index f6d5adb7b2..429b018e87 100644 --- a/src/schema/v2/conversation/conversations.ts +++ b/src/schema/v2/conversation/conversations.ts @@ -1,17 +1,17 @@ +import { CursorPageable, pageable } from "relay-cursor-paging" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { - GraphQLBoolean, - GraphQLFieldConfig, GraphQLInt, + GraphQLFieldConfig, GraphQLString, + GraphQLBoolean, } from "graphql" -import { connectionDefinitions, connectionFromArraySlice } from "graphql-relay" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" +import { connectionFromArraySlice, connectionDefinitions } from "graphql-relay" import { assign } from "lodash" -import { CursorPageable, pageable } from "relay-cursor-paging" -import { GraphQLEnumType } from "graphql" import { ConversationType } from "schema/v2/conversation" import { ResolverContext } from "types/graphql" +import { GraphQLEnumType } from "graphql" interface ConversationsArguments extends CursorPageable { dismissed?: boolean diff --git a/src/schema/v2/fair.ts b/src/schema/v2/fair.ts index b72c13c707..85a2984dfb 100644 --- a/src/schema/v2/fair.ts +++ b/src/schema/v2/fair.ts @@ -1,46 +1,47 @@ -import { - GraphQLBoolean, - GraphQLFieldConfig, - GraphQLInt, - GraphQLList, - GraphQLNonNull, - GraphQLObjectType, - GraphQLString, -} from "graphql" +import { omit, map, deburr } from "lodash" +import { pageable } from "relay-cursor-paging" import { connectionFromArraySlice } from "graphql-relay" -import { allViaLoader } from "lib/all" -import { dateRange, formattedOpeningHours } from "lib/date" import { convertConnectionArgsToGravityArgs } from "lib/helpers" -import { sponsoredContentForFair } from "lib/sponsoredContent" -import { deburr, map, omit } from "lodash" +import { dateRange, formattedOpeningHours } from "lib/date" +import { artistConnection } from "./artist" import moment from "moment" -import { pageable } from "relay-cursor-paging" -import { - connectionWithCursorInfo, - createPageCursors, - paginationResolver, -} from "schema/v2/fields/pagination" -import Partner, { PartnerType } from "schema/v2/partner/partner" -import { ResolverContext } from "types/graphql" -import { articleConnection } from "./article" -import Artist, { artistConnection } from "./artist" -import { FairOrganizerType } from "./fair_organizer" import cached from "./fields/cached" import date from "./fields/date" -import { markdown } from "./fields/markdown" import numeral from "./fields/numeral" +import Profile from "./profile" import Image from "./image" +import Artist from "./artist" +import Partner, { PartnerType } from "schema/v2/partner/partner" +import { ShowsConnection } from "./show" import { LocationType } from "./location" import { - NodeInterface, SlugAndInternalIDFields, SlugIDField, + NodeInterface, } from "./object_identification" -import Profile from "./profile" -import { ShowsConnection } from "./show" -import ArticleSorts from "./sorts/article_sorts" -import { FairArtistSortsType } from "./sorts/fairArtistSorts" +import { + GraphQLObjectType, + GraphQLString, + GraphQLBoolean, + GraphQLNonNull, + GraphQLList, + GraphQLFieldConfig, + GraphQLInt, +} from "graphql" import ShowSorts from "./sorts/show_sorts" +import { allViaLoader } from "lib/all" +import { FairArtistSortsType } from "./sorts/fairArtistSorts" +import { ResolverContext } from "types/graphql" +import { sponsoredContentForFair } from "lib/sponsoredContent" +import { markdown } from "./fields/markdown" +import { articleConnection } from "./article" +import ArticleSorts from "./sorts/article_sorts" +import { + connectionWithCursorInfo, + createPageCursors, + paginationResolver, +} from "schema/v2/fields/pagination" +import { FairOrganizerType } from "./fair_organizer" import { ExhibitionPeriodFormatEnum } from "./types/exhibitonPeriod" const FollowedContentType = new GraphQLObjectType({ @@ -144,7 +145,7 @@ export const FairType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: "LONG", + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/input_fields/event_status.ts b/src/schema/v2/input_fields/event_status.ts index d986a8eb29..fc54cf832f 100644 --- a/src/schema/v2/input_fields/event_status.ts +++ b/src/schema/v2/input_fields/event_status.ts @@ -26,13 +26,11 @@ const EVENT_STATUS_SORTS = { }, } as const -export const EVENT_STATUS_SORTS_ENUMS = new GraphQLEnumType({ - name: "EventStatus", - values: EVENT_STATUS_SORTS, -}) - export const EventStatus = { - type: EVENT_STATUS_SORTS_ENUMS, + type: new GraphQLEnumType({ + name: "EventStatus", + values: EVENT_STATUS_SORTS, + }), } export type EventStatusType = keyof typeof EVENT_STATUS_SORTS diff --git a/src/schema/v2/me/collection.ts b/src/schema/v2/me/collection.ts index 797c1369ec..ef6a0c15df 100644 --- a/src/schema/v2/me/collection.ts +++ b/src/schema/v2/me/collection.ts @@ -1,10 +1,10 @@ import { - GraphQLBoolean, GraphQLFieldConfig, - GraphQLInt, - GraphQLNonNull, GraphQLObjectType, + GraphQLNonNull, GraphQLString, + GraphQLBoolean, + GraphQLInt, } from "graphql" import { CatchCollectionNotFoundException, @@ -28,7 +28,8 @@ export const CollectionType = new GraphQLObjectType({ ...pageable({ sort: { type: CollectionArtworkSorts, - defaultValue: "SAVED_AT_DESC", + defaultValue: CollectionArtworkSorts.getValue("SAVED_AT_DESC")! + .value, }, page: { type: GraphQLInt }, }), diff --git a/src/schema/v2/me/savedArtworks.ts b/src/schema/v2/me/savedArtworks.ts index fd93c1b95e..a8fede1786 100644 --- a/src/schema/v2/me/savedArtworks.ts +++ b/src/schema/v2/me/savedArtworks.ts @@ -1,22 +1,22 @@ import { - GraphQLBoolean, GraphQLFieldConfig, - GraphQLInt, GraphQLNonNull, GraphQLString, + GraphQLBoolean, + GraphQLInt, } from "graphql" -import { - CatchCollectionNotFoundException, - convertConnectionArgsToGravityArgs, -} from "lib/helpers" -import { pageable } from "relay-cursor-paging" import { ResolverContext } from "types/graphql" -import { ArtworkType } from "../artwork" import { connectionWithCursorInfo, paginationResolver, } from "../fields/pagination" +import { ArtworkType } from "../artwork" +import { pageable } from "relay-cursor-paging" import CollectionArtworkSorts from "../sorts/collection_sorts" +import { + CatchCollectionNotFoundException, + convertConnectionArgsToGravityArgs, +} from "lib/helpers" export const COLLECTION_ID = "saved-artwork" @@ -48,7 +48,7 @@ export const SavedArtworks: GraphQLFieldConfig = { }, sort: { type: CollectionArtworkSorts, - defaultValue: "POSITION_DESC", + defaultValue: "-position", }, page: { type: GraphQLInt }, size: { type: GraphQLInt }, diff --git a/src/schema/v2/me/showsByFollowedArtists.ts b/src/schema/v2/me/showsByFollowedArtists.ts index bbe041206f..2cc601bf71 100644 --- a/src/schema/v2/me/showsByFollowedArtists.ts +++ b/src/schema/v2/me/showsByFollowedArtists.ts @@ -1,10 +1,10 @@ import { GraphQLFieldConfig } from "graphql" -import { connectionFromArraySlice } from "graphql-relay" import { getPagingParameters, pageable } from "relay-cursor-paging" import { ResolverContext } from "types/graphql" +import { connectionFromArraySlice } from "graphql-relay" import EventStatus from "../input_fields/event_status" -import { ShowsConnection } from "../show" import ShowSorts from "../sorts/show_sorts" +import { ShowsConnection } from "../show" export const ShowsByFollowedArtists: GraphQLFieldConfig< void, @@ -14,11 +14,11 @@ export const ShowsByFollowedArtists: GraphQLFieldConfig< args: pageable({ sort: { type: ShowSorts, - defaultValue: "CREATED_AT_DESC", + defaultValue: "-created_at", }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: "current", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/me/showsConnection.ts b/src/schema/v2/me/showsConnection.ts index 4a50fc3e8c..cc8c050f35 100644 --- a/src/schema/v2/me/showsConnection.ts +++ b/src/schema/v2/me/showsConnection.ts @@ -28,11 +28,11 @@ export const ShowsConnection: GraphQLFieldConfig = { }, sort: { type: ShowSorts, - defaultValue: "CREATED_AT_DESC", + defaultValue: "-created_at", }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: "current", description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/partner/partner.ts b/src/schema/v2/partner/partner.ts index 3765ba0d30..f5c52d26d3 100644 --- a/src/schema/v2/partner/partner.ts +++ b/src/schema/v2/partner/partner.ts @@ -1,53 +1,53 @@ +import { CursorPageable, pageable } from "relay-cursor-paging" import { + GraphQLString, + GraphQLObjectType, + GraphQLNonNull, + GraphQLInt, + GraphQLList, GraphQLBoolean, GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, - GraphQLInt, - GraphQLList, - GraphQLNonNull, - GraphQLObjectType, - GraphQLString, } from "graphql" import { connectionFromArraySlice } from "graphql-relay" -import { allViaLoader } from "lib/all" -import { deprecate } from "lib/deprecation" -import { includesFieldsOtherThanSelectionSet } from "lib/hasFieldSelection" -import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { flatten } from "lodash" -import { CursorPageable, pageable } from "relay-cursor-paging" -import { articleConnection } from "schema/v2/article" -import { ArtistType } from "schema/v2/artist" -import { artworkConnection } from "schema/v2/artwork" +import { convertConnectionArgsToGravityArgs } from "lib/helpers" import cached from "schema/v2/fields/cached" import initials from "schema/v2/fields/initials" -import numeral from "schema/v2/fields/numeral" -import { - connectionWithCursorInfo, - createPageCursors, - paginationResolver, -} from "schema/v2/fields/pagination" +import Profile from "schema/v2/profile" +import { locationsConnection, LocationType } from "schema/v2/location" import EventStatus from "schema/v2/input_fields/event_status" -import { LocationType, locationsConnection } from "schema/v2/location" import { NodeInterface, SlugAndInternalIDFields, } from "schema/v2/object_identification" -import Profile from "schema/v2/profile" -import { ShowType, ShowsConnection } from "schema/v2/show" -import ArticleSorts, { ArticleSort } from "schema/v2/sorts/article_sorts" -import ArtistSorts from "schema/v2/sorts/artist_sorts" +import { artworkConnection } from "schema/v2/artwork" +import numeral from "schema/v2/fields/numeral" +import { ShowsConnection, ShowType } from "schema/v2/show" +import { ArtistType } from "schema/v2/artist" import ArtworkSorts from "schema/v2/sorts/artwork_sorts" -import ShowSorts from "schema/v2/sorts/show_sorts" +import { includesFieldsOtherThanSelectionSet } from "lib/hasFieldSelection" import { ResolverContext } from "types/graphql" -import { fields as partnerArtistFields } from "./partner_artist" import { PartnerCategoryType } from "./partner_category" +import ShowSorts from "schema/v2/sorts/show_sorts" +import ArtistSorts from "schema/v2/sorts/artist_sorts" +import { fields as partnerArtistFields } from "./partner_artist" +import { + connectionWithCursorInfo, + createPageCursors, + paginationResolver, +} from "schema/v2/fields/pagination" +import { deprecate } from "lib/deprecation" +import { articleConnection } from "schema/v2/article" +import ArticleSorts, { ArticleSort } from "schema/v2/sorts/article_sorts" +import { allViaLoader } from "lib/all" import { truncate } from "lib/helpers" -import { compact } from "lodash" import { setVersion } from "schema/v2/image/normalize" -import { AlertsSummaryFields } from "../alerts" -import { PartnerDocumentsConnection } from "./partnerDocumentsConnection" +import { compact } from "lodash" import { InquiryRequestType } from "./partnerInquiryRequest" +import { PartnerDocumentsConnection } from "./partnerDocumentsConnection" +import { AlertsSummaryFields } from "../alerts" const isFairOrganizer = (type) => type === "FairOrganizer" const isGallery = (type) => type === "PartnerGallery" @@ -776,7 +776,7 @@ export const PartnerType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: "current", description: "Filter shows by chronological event status", }, isDisplayable: { diff --git a/src/schema/v2/show.ts b/src/schema/v2/show.ts index 23ea674298..08b6dad47b 100644 --- a/src/schema/v2/show.ts +++ b/src/schema/v2/show.ts @@ -1,51 +1,51 @@ +import moment from "moment" +import { pageable } from "relay-cursor-paging" import { - GraphQLBoolean, - GraphQLFieldConfig, - GraphQLFieldConfigArgumentMap, - GraphQLInt, - GraphQLList, - GraphQLNonNull, - GraphQLObjectType, - GraphQLString, - GraphQLUnionType, -} from "graphql" -import { - Connection, - connectionDefinitions, - connectionFromArray, connectionFromArraySlice, + connectionFromArray, + connectionDefinitions, + Connection, } from "graphql-relay" -import { HTTPError } from "lib/HTTPError" -import { dateRange, exhibitionStatus } from "lib/date" import { - convertConnectionArgsToGravityArgs, - existyValue, isExisty, + existyValue, + convertConnectionArgsToGravityArgs, } from "lib/helpers" -import { totalViaLoader } from "lib/total" -import { find, flatten } from "lodash" -import moment from "moment" -import { pageable } from "relay-cursor-paging" -import { connectionWithCursorInfo } from "schema/v2/fields/pagination" -import { PartnerType } from "schema/v2/partner/partner" -import Artist from "./artist" -import { artworkConnection } from "./artwork" -import { ExternalPartnerType } from "./external_partner" -import Fair from "./fair" +import { HTTPError } from "lib/HTTPError" +import numeral from "./fields/numeral" +import { dateRange, exhibitionStatus } from "lib/date" import cached from "./fields/cached" import date from "./fields/date" import { markdown } from "./fields/markdown" -import numeral from "./fields/numeral" -import Image, { getDefault, normalizeImageData } from "./image" +import Artist from "./artist" +import { PartnerType } from "schema/v2/partner/partner" +import { ExternalPartnerType } from "./external_partner" +import Fair from "./fair" +import { artworkConnection } from "./artwork" import { LocationType } from "./location" -import { NodeInterface, SlugAndInternalIDFields } from "./object_identification" +import Image, { getDefault, normalizeImageData } from "./image" import ShowEventType from "./show_event" +import { connectionWithCursorInfo } from "schema/v2/fields/pagination" +import { NodeInterface, SlugAndInternalIDFields } from "./object_identification" +import { + GraphQLObjectType, + GraphQLString, + GraphQLNonNull, + GraphQLList, + GraphQLInt, + GraphQLBoolean, + GraphQLUnionType, + GraphQLFieldConfig, + GraphQLFieldConfigArgumentMap, +} from "graphql" +import { totalViaLoader } from "lib/total" +import { find, flatten } from "lodash" -import followArtistsResolver from "lib/shared_resolvers/followedArtistsResolver" -import { ResolverContext } from "types/graphql" -import { LOCAL_DISCOVERY_RADIUS_KM } from "./city/constants" -import EventStatus from "./input_fields/event_status" import ShowSorts from "./sorts/show_sorts" +import EventStatus from "./input_fields/event_status" +import { LOCAL_DISCOVERY_RADIUS_KM } from "./city/constants" +import { ResolverContext } from "types/graphql" +import followArtistsResolver from "lib/shared_resolvers/followedArtistsResolver" import { ExhibitionPeriodFormatEnum } from "./types/exhibitonPeriod" const FollowArtistType = new GraphQLObjectType({ @@ -343,7 +343,7 @@ export const ShowType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: "LONG", + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/show_event.ts b/src/schema/v2/show_event.ts index c590695412..0c39252ce6 100644 --- a/src/schema/v2/show_event.ts +++ b/src/schema/v2/show_event.ts @@ -36,7 +36,7 @@ const ShowEventType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: "LONG", + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/sorts/show_sorts.ts b/src/schema/v2/sorts/show_sorts.ts index 49b1677783..e9b3a12a19 100644 --- a/src/schema/v2/sorts/show_sorts.ts +++ b/src/schema/v2/sorts/show_sorts.ts @@ -1,7 +1,6 @@ import { GraphQLEnumType } from "graphql" const SHOW_SORTS = { - CREATED_AT_DESC: { value: "-created_at" }, END_AT_ASC: { value: "end_at" }, END_AT_DESC: { value: "-end_at" }, FEATURED_ASC: { value: "featured" }, From e53c0701eb5a4c62bf5d3424f2f8bbbae74220da Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 11:35:48 +0100 Subject: [PATCH 14/26] chore: will keep fixing enums until they give up --- _schemaV2.graphql | 2473 +---------------- package.json | 2 +- src/index.ts | 17 +- .../replaceCommerceDateTimeType.ts | 15 +- src/lib/stitching/mergeSchemas.ts | 22 +- src/schema/v2/Match.ts | 18 +- src/schema/v2/city/index.ts | 6 +- src/schema/v2/conversation/conversations.ts | 2 +- src/schema/v2/fair.ts | 2 +- src/schema/v2/input_fields/event_status.ts | 10 +- src/schema/v2/me/showsByFollowedArtists.ts | 8 +- src/schema/v2/me/showsConnection.ts | 8 +- src/schema/v2/partner/partner.ts | 6 +- src/schema/v2/show.ts | 8 +- src/schema/v2/show_event.ts | 2 +- src/schema/v2/sorts/show_sorts.ts | 1 + yarn.lock | 78 +- 17 files changed, 205 insertions(+), 2473 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 6eb070a742..cd2cf7ac96 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -3860,7 +3860,7 @@ type City { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection slug: String! sponsoredContent: CitySponsoredContent @@ -3929,1922 +3929,34 @@ type CollectionsConnection { # A list of edges. edges: [CollectionsEdge] pageCursors: PageCursors! - - # Information to aid in pagination. - pageInfo: PageInfo! - totalCount: Int -} - -# An edge in a connection. -type CollectionsEdge { - # A cursor for use in pagination - cursor: String! - - # The item at the end of the edge - node: Collection -} - -enum CollectionSorts { - CREATED_AT_ASC - CREATED_AT_DESC - UPDATED_AT_ASC - UPDATED_AT_DESC -} - -type CollectorProfileArtists { - name: String -} - -type CollectorProfileType { - artsyUserSince( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - bio: String - collectorLevel: Int - - # List of artists the Collector is interested in. - collectorProfileArtists: [CollectorProfileArtists] - companyName: String - companyWebsite: String - confirmedBuyerAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - email: String - emailConfirmed: Boolean - @deprecated( - reason: "emailConfirmed is going to be removed, use isEmailConfirmed instead" - ) - icon: Image - - # A globally unique ID. - id: ID! - identityVerified: Boolean - @deprecated( - reason: "identityVerified is going to be removed, use isIdentityVerified instead" - ) - initials(length: Int = 3): String - institutionalAffiliations: String - intents: [String] - - # A type-specific ID likely used as a database ID. - internalID: ID! - isActiveBidder: Boolean - isActiveInquirer: Boolean - isEmailConfirmed: Boolean - isIdentityVerified: Boolean - isProfileComplete: Boolean - location: MyLocation - loyaltyApplicantAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - name: String - - # Collector's position with relevant institutions - otherRelevantPositions: String - - # User ID of the collector profile's owner - ownerID: ID! - privacy: String - profession: String - professionalBuyerAppliedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - professionalBuyerAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - selfReportedPurchases: String - userInterests: [UserInterest]! -} - -# A connection to a list of items. -type CollectorProfileTypeConnection { - # A list of edges. - edges: [CollectorProfileTypeEdge] - pageCursors: PageCursors! - - # Information to aid in pagination. - pageInfo: PageInfo! - totalCount: Int -} - -# An edge in a connection. -type CollectorProfileTypeEdge { - # A cursor for use in pagination - cursor: String! - - # The item at the end of the edge - node: CollectorProfileType -} - -# Represents either an action or a potential failure -union CommerceActionOrFailureUnion = - CommerceOrderRequiresAction - | CommerceOrderWithMutationFailure - -# Autogenerated input type of AddInitialOfferToOrder -input CommerceAddInitialOfferToOrderInput { - amountCents: Int! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - note: String - orderId: ID! -} - -# Autogenerated return type of AddInitialOfferToOrder. -type CommerceAddInitialOfferToOrderPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# An generic error type for mutations -type CommerceApplicationError { - # Code of this error - code: String! - - # What caused the error - data: String - - # Type of this error - type: String! -} - -# Autogenerated input type of ApproveOrder -input CommerceApproveOrderInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! - shippingContact: CommerceShippingContactAttributes -} - -# Autogenerated return type of ApproveOrder. -type CommerceApproveOrderPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Bank account balance -type CommerceBankAccountBalance { - balanceCents: Int - currencyCode: String -} - -# Autogenerated input type of BuyerAcceptOffer -input CommerceBuyerAcceptOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - offerId: ID! -} - -# Autogenerated return type of BuyerAcceptOffer. -type CommerceBuyerAcceptOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of BuyerCounterOffer -input CommerceBuyerCounterOfferInput { - amountCents: Int! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - note: String - offerId: ID! -} - -# Autogenerated return type of BuyerCounterOffer. -type CommerceBuyerCounterOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -enum CommerceBuyerOfferActionEnum { - # Buyer's offer is accepted and final - OFFER_ACCEPTED - - # Buyer's offer accepted, needs to confirm tax and shipping - OFFER_ACCEPTED_CONFIRM_NEEDED - - # Buyer received a counter offer - OFFER_RECEIVED - - # Buyer received a counter, offer needs to confirm tax and shipping - OFFER_RECEIVED_CONFIRM_NEEDED - - # Buyer's payment failed - PAYMENT_FAILED - - # Provisional offer is accepted and tax/shipping confirmed - PROVISIONAL_OFFER_ACCEPTED -} - -# Autogenerated input type of BuyerRejectOffer -input CommerceBuyerRejectOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - offerId: ID! - rejectReason: CommerceCancelReasonTypeEnum -} - -# Autogenerated return type of BuyerRejectOffer. -type CommerceBuyerRejectOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -type CommerceBuyOrder implements CommerceOrder { - # Whether Artsy collects taxes (e.g., sales tax or VAT) on this order. - artsyCollectsTaxes: Boolean - artsyRemitsTaxes: Boolean - artsyTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - artsyTotalCents: Int - artworkDetails: String - availablePaymentMethods: [CommercePaymentMethodEnum!]! - bankAccountId: String - buyer: CommerceOrderPartyUnion! - buyerDetails: OrderParty - buyerPhoneNumber: String - buyerPhoneNumberCountryCode: String - buyerProfile: CollectorProfileType - buyerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - buyerTotalCents: Int - code: String! - commissionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - commissionFeeCents: Int - commissionRate: Float - conditionsOfSale: String - conversation: Conversation - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - creditCard: CreditCard - creditCardId: String - currencyCode: String! - displayCommissionRate: String - displayState: CommerceOrderDisplayStateEnum! - id: ID! - impulseConversationId: String - internalID: ID! - itemsTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - - # Item total in cents, for Offer Orders this field reflects current offer - itemsTotalCents: Int - lastApprovedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - lastSubmittedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - lastTransactionFailed: Boolean - lineItems( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - ): CommerceLineItemConnection - mode: CommerceOrderModeEnum - orderHistory: [CommerceOrderEventUnion!]! - orderUpdateState: String - paymentMethod: CommercePaymentMethodEnum - paymentMethodDetails: PaymentMethodUnion - requestedFulfillment: CommerceRequestedFulfillmentUnion - - # Whether the buyer needs to complete identity verification to make this purchase. - requireIdentityVerification: Boolean! - seller: CommerceOrderPartyUnion! - sellerDetails: OrderParty - sellerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - sellerTotalCents: Int - shippingRadius: String - shippingTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - shippingTotalCents: Int - source: CommerceOrderSourceEnum! - state: CommerceOrderStateEnum! - stateExpiresAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - stateReason: String - stateUpdatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - taxTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - taxTotalCents: Int - taxTypes: [CommerceTaxTypeEnum!]! - totalListPrice( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - totalListPriceCents: Int! - transactionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - transactionFeeCents: Int - updatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -enum CommerceCancelReasonTypeEnum { - # cancelation reason is: admin_canceled - ADMIN_CANCELED - - # cancelation reason is: admin_failed_review - ADMIN_FAILED_REVIEW - - # cancelation reason is: buyer_lapsed - BUYER_LAPSED - - # cancelation reason is: buyer_rejected - BUYER_REJECTED - - # cancelation reason is: funds_not_received - FUNDS_NOT_RECEIVED - - # cancelation reason is: seller_lapsed - SELLER_LAPSED - - # cancelation reason is: seller_rejected - SELLER_REJECTED - - # cancelation reason is: seller_rejected_artwork_unavailable - SELLER_REJECTED_ARTWORK_UNAVAILABLE - - # cancelation reason is: seller_rejected_offer_too_low - SELLER_REJECTED_OFFER_TOO_LOW - - # cancelation reason is: seller_rejected_other - SELLER_REJECTED_OTHER - - # cancelation reason is: seller_rejected_shipping_unavailable - SELLER_REJECTED_SHIPPING_UNAVAILABLE -} - -# Autogenerated input type of ConfirmFulfillment -input CommerceConfirmFulfillmentInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! -} - -# Autogenerated return type of ConfirmFulfillment. -type CommerceConfirmFulfillmentPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of ConfirmPickup -input CommerceConfirmPickupInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! -} - -# Autogenerated return type of ConfirmPickup. -type CommerceConfirmPickupPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of CreateBankDebitSetupForOrder -input CommerceCreateBankDebitSetupForOrderInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! -} - -# Autogenerated return type of CreateBankDebitSetupForOrder. -type CommerceCreateBankDebitSetupForOrderPayload { - # A union of action data and failure - actionOrError: CommerceActionOrFailureUnion! - - # A unique identifier for the client performing the mutation. - clientMutationId: String -} - -# Autogenerated input type of CreateInquiryOfferOrderWithArtwork -input CommerceCreateInquiryOfferOrderWithArtworkInput { - # Artwork Id - artworkId: String! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # EditionSet Id - editionSetId: String - - # When set to false, we will create a new order. Otherwise if current user has - # submitted orders on same artwork/edition with same quantity, we will return that - findActiveOrCreate: Boolean = true - - # Impulse conversation id corresponding to an order. - impulseConversationId: String! - - # Number of items in the line item, default is 1 - quantity: Int -} - -# Autogenerated return type of CreateInquiryOfferOrderWithArtwork. -type CommerceCreateInquiryOfferOrderWithArtworkPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure. If find_active_or_create is not false, it will - # return existing submitted order for current user if exists, otherwise it will - # return newly created order - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of CreateInquiryOrderWithArtwork -input CommerceCreateInquiryOrderWithArtworkInput { - # Artwork Id - artworkId: String! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # EditionSet Id - editionSetId: String - - # Impulse conversation id corresponding to an order. - impulseConversationId: String! - - # Number of items in the line item - quantity: Int -} - -# Autogenerated return type of CreateInquiryOrderWithArtwork. -type CommerceCreateInquiryOrderWithArtworkPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of CreateOfferOrderWithArtwork -input CommerceCreateOfferOrderWithArtworkInput { - # Artwork Id - artworkId: String! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # EditionSet Id - editionSetId: String - - # When set to false, we will create a new order. Otherwise if current user has - # submitted orders on same artwork/edition with same quantity, we will return that - findActiveOrCreate: Boolean = true - - # Number of items in the line item, default is 1 - quantity: Int -} - -# Autogenerated return type of CreateOfferOrderWithArtwork. -type CommerceCreateOfferOrderWithArtworkPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure. If find_active_or_create is not false, it will - # return existing submitted order for current user if exists, otherwise it will - # return newly created order - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of CreateOrderWithArtwork -input CommerceCreateOrderWithArtworkInput { - # Artwork Id - artworkId: String! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # EditionSet Id - editionSetId: String - - # Number of items in the line item - quantity: Int -} - -# Autogenerated return type of CreateOrderWithArtwork. -type CommerceCreateOrderWithArtworkPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of CreatePartnerOfferOrder -input CommerceCreatePartnerOfferOrderInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # EditionSet Id - editionSetId: String - - # PartnerOffer Id - partnerOfferId: String! - - # Number of items in the line item - quantity: Int -} - -# Autogenerated return type of CreatePartnerOfferOrder. -type CommerceCreatePartnerOfferOrderPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Date in YYYY-MM-DD format -scalar CommerceDate - -# An ISO 8601 datetime -scalar CommerceDateTime - -enum CommerceEeiFormStatusEnum { - # approved - APPROVED - - # cleared - CLEARED - - # pending - PENDING - - # rejected - REJECTED - - # submitted - SUBMITTED -} - -interface CommerceEventInterface { - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -# Autogenerated input type of FixFailedPayment -input CommerceFixFailedPaymentInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - creditCardId: String! - offerId: ID - orderId: ID -} - -# Autogenerated return type of FixFailedPayment. -type CommerceFixFailedPaymentPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of FulfillAtOnce -input CommerceFulfillAtOnceInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - fulfillment: CommerceFulfillmentAttributes! - id: ID! -} - -# Autogenerated return type of FulfillAtOnce. -type CommerceFulfillAtOncePayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# A Fulfillment for an order -type CommerceFulfillment { - courier: String! - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - estimatedDelivery( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - id: ID! - internalID: ID! - notes: String - trackingId: String - updatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -# Attributes of a Fulfillment -input CommerceFulfillmentAttributes { - courier: String! - estimatedDelivery: CommerceDate - notes: String - trackingId: String -} - -# The connection type for Fulfillment. -type CommerceFulfillmentConnection { - # A list of edges. - edges: [CommerceFulfillmentEdge] - - # A list of nodes. - nodes: [CommerceFulfillment] - - # Information to aid in pagination. - pageInfo: CommercePageInfo! -} - -# An edge in a connection. -type CommerceFulfillmentEdge { - # A cursor for use in pagination. - cursor: String! - - # The item at the end of the edge. - node: CommerceFulfillment -} - -# A Line Item -type CommerceLineItem { - artwork: Artwork - artworkId: String! - artworkOrEditionSet: ArtworkOrEditionSetType - artworkVersion: ArtworkVersion - artworkVersionId: String! - commissionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - commissionFeeCents: Int - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - editionSetId: String - fulfillments( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - ): CommerceFulfillmentConnection - id: ID! - internalID: ID! - listPrice( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - listPriceCents: Int! - order: CommerceOrder! - priceCents: Int! @deprecated(reason: "switch to use listPriceCents") - quantity: Int! - selectedShippingQuote: CommerceShippingQuote - shipment: CommerceShipment - shippingQuoteOptions( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - ): CommerceShippingQuoteConnection - shippingTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - shippingTotalCents: Int - updatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -# The connection type for LineItem. -type CommerceLineItemConnection { - # A list of edges. - edges: [CommerceLineItemEdge] - - # A list of nodes. - nodes: [CommerceLineItem] - - # Information to aid in pagination. - pageInfo: CommercePageInfo! -} - -# An edge in a connection. -type CommerceLineItemEdge { - # A cursor for use in pagination. - cursor: String! - - # The item at the end of the edge. - node: CommerceLineItem -} - -# An Offer -type CommerceOffer { - amount( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - amountCents: Int! - buyerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - buyerTotalCents: Int - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - creatorId: String! - currencyCode: String! - - # True when this offer fills in the missing fees from the previous one - definesTotal: Boolean! - from: CommerceOrderPartyUnion! - fromDetails: OrderParty - fromParticipant: CommerceOrderParticipantEnum - - # True when a all the fees (shipping/tax) were calculated for the offer - hasDefiniteTotal: Boolean! - id: ID! - internalID: ID! - note: String - - # Only false when previous offer has the same amount. - offerAmountChanged: Boolean! - order: CommerceOrder! - respondsTo: CommerceOffer - shippingTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - shippingTotalCents: Int - submittedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - taxTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - taxTotalCents: Int -} - -# The connection type for Offer. -type CommerceOfferConnection { - # A list of edges. - edges: [CommerceOfferEdge] - - # A list of nodes. - nodes: [CommerceOffer] - - # Information to aid in pagination. - pageInfo: CommercePageInfo! -} - -# An edge in a connection. -type CommerceOfferEdge { - # A cursor for use in pagination. - cursor: String! - - # The item at the end of the edge. - node: CommerceOffer -} - -type CommerceOfferOrder implements CommerceOrder { - # Whether Artsy collects taxes (e.g., sales tax or VAT) on this order. - artsyCollectsTaxes: Boolean - artsyRemitsTaxes: Boolean - artsyTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - artsyTotalCents: Int - artworkDetails: String - availablePaymentMethods: [CommercePaymentMethodEnum!]! - awaitingResponseFrom: CommerceOrderParticipantEnum - bankAccountId: String - buyer: CommerceOrderPartyUnion! - - # Type of action buyer needs to perform in response to the offer - buyerAction: CommerceBuyerOfferActionEnum - buyerDetails: OrderParty - buyerPhoneNumber: String - buyerPhoneNumberCountryCode: String - buyerProfile: CollectorProfileType - buyerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - buyerTotalCents: Int - code: String! - commissionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - commissionFeeCents: Int - commissionRate: Float - conditionsOfSale: String - conversation: Conversation - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - creditCard: CreditCard - creditCardId: String - currencyCode: String! - displayCommissionRate: String - displayState: CommerceOrderDisplayStateEnum! - id: ID! - impulseConversationId: String - internalID: ID! - isInquiryOrder: Boolean! - itemsTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - - # Item total in cents, for Offer Orders this field reflects current offer - itemsTotalCents: Int - lastApprovedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - - # Last submitted offer - lastOffer: CommerceOffer - lastSubmittedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - lastTransactionFailed: Boolean - lineItems( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - ): CommerceLineItemConnection - mode: CommerceOrderModeEnum - myLastOffer: CommerceOffer - offers( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - fromId: String - fromType: String - - # Returns the last _n_ elements from the list. - last: Int - ): CommerceOfferConnection - offerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - orderHistory: [CommerceOrderEventUnion!]! - orderUpdateState: String - paymentMethod: CommercePaymentMethodEnum - paymentMethodDetails: PaymentMethodUnion - requestedFulfillment: CommerceRequestedFulfillmentUnion - - # Whether the buyer needs to complete identity verification to make this purchase. - requireIdentityVerification: Boolean! - seller: CommerceOrderPartyUnion! - sellerDetails: OrderParty - sellerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - sellerTotalCents: Int - shippingRadius: String - shippingTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - shippingTotalCents: Int - source: CommerceOrderSourceEnum! - state: CommerceOrderStateEnum! - stateExpiresAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - stateReason: String - stateUpdatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - taxTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - taxTotalCents: Int - taxTypes: [CommerceTaxTypeEnum!]! - totalListPrice( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - totalListPriceCents: Int! - transactionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - transactionFeeCents: Int - updatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -type CommerceOfferSubmittedEvent implements CommerceEventInterface { - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - offer: CommerceOffer! -} - -# Order -interface CommerceOrder { - # Whether Artsy collects taxes (e.g., sales tax or VAT) on this order. - artsyCollectsTaxes: Boolean - artsyRemitsTaxes: Boolean - artsyTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - artsyTotalCents: Int - artworkDetails: String - availablePaymentMethods: [CommercePaymentMethodEnum!]! - bankAccountId: String - buyer: CommerceOrderPartyUnion! - buyerDetails: OrderParty - buyerPhoneNumber: String - buyerPhoneNumberCountryCode: String - buyerProfile: CollectorProfileType - buyerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - buyerTotalCents: Int - code: String! - commissionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - commissionFeeCents: Int - commissionRate: Float - conditionsOfSale: String - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - creditCard: CreditCard - creditCardId: String - currencyCode: String! - displayCommissionRate: String - displayState: CommerceOrderDisplayStateEnum! - id: ID! - impulseConversationId: String - internalID: ID! - itemsTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - - # Item total in cents, for Offer Orders this field reflects current offer - itemsTotalCents: Int - lastApprovedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - lastSubmittedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - lastTransactionFailed: Boolean - lineItems( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - ): CommerceLineItemConnection - mode: CommerceOrderModeEnum - orderHistory: [CommerceOrderEventUnion!]! - orderUpdateState: String - paymentMethod: CommercePaymentMethodEnum - paymentMethodDetails: PaymentMethodUnion - requestedFulfillment: CommerceRequestedFulfillmentUnion - - # Whether the buyer needs to complete identity verification to make this purchase. - requireIdentityVerification: Boolean! - seller: CommerceOrderPartyUnion! - sellerDetails: OrderParty - sellerTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - sellerTotalCents: Int - shippingRadius: String - shippingTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - shippingTotalCents: Int - source: CommerceOrderSourceEnum! - state: CommerceOrderStateEnum! - stateExpiresAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - stateReason: String - stateUpdatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - taxTotal( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - taxTotalCents: Int - taxTypes: [CommerceTaxTypeEnum!]! - totalListPrice( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - totalListPriceCents: Int! - transactionFee( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," - ): String - transactionFeeCents: Int - updatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -# Order Action data -type CommerceOrderActionData { - clientSecret: String! -} - -# Fields to sort by -enum CommerceOrderConnectionSortEnum { - # Sort by the timestamp the state of the order expires at in ascending order - STATE_EXPIRES_AT_ASC - - # Sort by the timestamp the state of the order expires at in descending order - STATE_EXPIRES_AT_DESC - - # Sort by the timestamp the state of order was last updated in ascending order - STATE_UPDATED_AT_ASC - - # Sort by the timestamp the state of order was last updated in descending order - STATE_UPDATED_AT_DESC - - # Sort by the timestamp the order was last updated in ascending order - UPDATED_AT_ASC - - # Sort by the timestamp the order was last updated in descending order - UPDATED_AT_DESC -} - -# The connection type for Order. -type CommerceOrderConnectionWithTotalCount { - # A list of edges. - edges: [CommerceOrderEdge] - - # A list of nodes. - nodes: [CommerceOrder] - pageCursors: CommercePageCursors - - # Information to aid in pagination. - pageInfo: CommercePageInfo! - totalCount: Int - totalPages: Int -} - -enum CommerceOrderDisplayStateEnum { - # order is abandoned by buyer and never submitted - ABANDONED - - # order is approved by seller - APPROVED - - # order is canceled - CANCELED - - # order is fulfilled by seller - FULFILLED - - # order has been collected and is with shipper - IN_TRANSIT - - # order is still pending submission by buyer - PENDING - - # order is approved but not yet sent out - PROCESSING - - # order approval is processing and will be updated when complete - PROCESSING_APPROVAL - - # order is refunded after being approved or fulfilled - REFUNDED - - # order is submitted by buyer - SUBMITTED -} - -# An edge in a connection. -type CommerceOrderEdge { - # A cursor for use in pagination. - cursor: String! - - # The item at the end of the edge. - node: CommerceOrder -} - -# Represents either a state change or new offer -union CommerceOrderEventUnion = - CommerceOfferSubmittedEvent - | CommerceOrderStateChangedEvent - -enum CommerceOrderFulfillmentTypeEnum { - # fulfillment type is: pickup - PICKUP - - # fulfillment type is: ship - SHIP - - # fulfillment type is: ship_arta - SHIP_ARTA -} - -enum CommerceOrderModeEnum { - # Buy Order - BUY - - # Offer Order - OFFER -} - -# Represents either a resolved Order or a potential failure -union CommerceOrderOrFailureUnion = - CommerceOrderRequiresAction - | CommerceOrderWithMutationFailure - | CommerceOrderWithMutationSuccess - -enum CommerceOrderParticipantEnum { - # Participant on the buyer side - BUYER - - # Participant on the seller side - SELLER -} - -# Represents either a partner or a user -union CommerceOrderPartyUnion = CommercePartner | CommerceUser - -# Data reflecting actions required -type CommerceOrderRequiresAction { - # Data related to action needed - actionData: CommerceOrderActionData! -} - -enum CommerceOrderSourceEnum { - # The order was originated on the artwork page - artwork_page - - # The order was originated on a conversation - inquiry - - # The order was originated from a partner offer - partner_offer - - # The order was originated from a private sale - private_sale -} - -type CommerceOrderStateChangedEvent implements CommerceEventInterface { - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - orderUpdateState: String - state: CommerceOrderStateEnum! - stateReason: String -} - -enum CommerceOrderStateEnum { - # order is abandoned by buyer and never submitted - ABANDONED - - # order is approved by seller - APPROVED - - # order is canceled - CANCELED - - # order is fulfilled by seller - FULFILLED - - # order is undergoing review by Artsy admins - IN_REVIEW - - # order is still pending submission by buyer - PENDING - - # order approval is processing and will be updated when complete - PROCESSING_APPROVAL - - # order is refunded after being approved or fulfilled - REFUNDED - - # order is submitted by buyer - SUBMITTED -} - -# An error response for changes to an order -type CommerceOrderWithMutationFailure { - error: CommerceApplicationError! -} - -# A successfully returned order type -type CommerceOrderWithMutationSuccess { - order: CommerceOrder! -} - -type CommercePageCursor { - # first cursor on the page - cursor: String! - - # is this the current page? - isCurrent: Boolean! - - # page number out of totalPages - page: Int! -} - -type CommercePageCursors { - around: [CommercePageCursor!]! - - # optional, may be included in field around - first: CommercePageCursor - - # optional, may be included in field around - last: CommercePageCursor - previous: CommercePageCursor -} - -# Information about pagination in a connection. -type CommercePageInfo { - # When paginating forwards, the cursor to continue. - endCursor: String - - # When paginating forwards, are there more items? - hasNextPage: Boolean! - - # When paginating backwards, are there more items? - hasPreviousPage: Boolean! - - # When paginating backwards, the cursor to continue. - startCursor: String -} - -type CommercePartner { - id: String! - type: String! -} - -enum CommercePaymentMethodEnum { - # Credit Card - CREDIT_CARD - - # SEPA - SEPA_DEBIT - - # US Bank Account - US_BANK_ACCOUNT - - # Wire Transfer - WIRE_TRANSFER -} - -type CommercePickup { - fulfillmentType: String! - phoneNumber: String -} - -# Represents either a shipping information or pickup -union CommerceRequestedFulfillmentUnion = - CommercePickup - | CommerceShip - | CommerceShipArta - -# Autogenerated input type of SelectShippingOption -input CommerceSelectShippingOptionInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! - selectedShippingQuoteId: ID! -} - -# Autogenerated return type of SelectShippingOption. -type CommerceSelectShippingOptionPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SellerAcceptOffer -input CommerceSellerAcceptOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - offerId: ID! - shippingContact: CommerceShippingContactAttributes -} - -# Autogenerated return type of SellerAcceptOffer. -type CommerceSellerAcceptOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SellerAcceptProvisionalOffer -input CommerceSellerAcceptProvisionalOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # If location was set in the accept offer step - locationFilledOnOrder: Boolean - offerId: ID! - - # Shipping info belonging to this specific order. It overrides the defined shipping costs of the artwork. - shippingTotalCents: Int -} - -# Autogenerated return type of SellerAcceptProvisionalOffer. -type CommerceSellerAcceptProvisionalOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SellerCounterOffer -input CommerceSellerCounterOfferInput { - amountCents: Int! - - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # If location was set in the counter offer step - locationFilledOnOrder: Boolean - note: String - offerId: ID! - shippingContact: CommerceShippingContactAttributes - - # Shipping info belonging to this specific order. It overrides the defined shipping costs of the artwork. - shippingTotalCents: Int -} - -# Autogenerated return type of SellerCounterOffer. -type CommerceSellerCounterOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SellerRejectOffer -input CommerceSellerRejectOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - offerId: ID! - rejectReason: CommerceCancelReasonTypeEnum -} - -# Autogenerated return type of SellerRejectOffer. -type CommerceSellerRejectOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SetPaymentByStripeIntent -input CommerceSetPaymentByStripeIntentInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! - oneTimeUse: Boolean = false - setupIntentId: String! -} - -# Autogenerated return type of SetPaymentByStripeIntent. -type CommerceSetPaymentByStripeIntentPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SetPayment -input CommerceSetPaymentInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! - paymentMethod: CommercePaymentMethodEnum! - paymentMethodId: String -} - -# Autogenerated return type of SetPayment. -type CommerceSetPaymentPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SetShipping -input CommerceSetShippingInput { - addressVerifiedBy: CommerceShippingAddressVerifiedByEnum - - # A unique identifier for the client performing the mutation. - clientMutationId: String - fulfillmentType: CommerceOrderFulfillmentTypeEnum! - id: ID! - phoneNumber: String - phoneNumberCountryCode: String - shipping: CommerceShippingAttributes + + # Information to aid in pagination. + pageInfo: PageInfo! + totalCount: Int } -# Autogenerated return type of SetShipping. -type CommerceSetShippingPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String +# An edge in a connection. +type CollectionsEdge { + # A cursor for use in pagination + cursor: String! - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! + # The item at the end of the edge + node: Collection } -type CommerceShip { - addressLine1: String - addressLine2: String - city: String - country: String - name: String - phoneNumber: String - postalCode: String - region: String +enum CollectionSorts { + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC } -type CommerceShipArta { - addressLine1: String - addressLine2: String - city: String - country: String +type CollectorProfileArtists { name: String - phoneNumber: String - postalCode: String - region: String } -# A shipment -type CommerceShipment { - bookedAt: String - carrierName: String - contactEmail: String - contactName: String - contactPhone: String - createdAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! - deliveryEnd( +type CollectorProfileType { + artsyUserSince( format: String # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See @@ -5852,7 +3964,14 @@ type CommerceShipment { # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String - deliveryStart( + bio: String + collectorLevel: Int + + # List of artists the Collector is interested in. + collectorProfileArtists: [CollectorProfileArtists] + companyName: String + companyWebsite: String + confirmedBuyerAt( format: String # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See @@ -5860,21 +3979,32 @@ type CommerceShipment { # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String - deliveryWindowModifier: String - eeiFormStatus: CommerceEeiFormStatusEnum - estimatedDeliveryWindow: String - estimatedPickupWindow: String + email: String + emailConfirmed: Boolean + @deprecated( + reason: "emailConfirmed is going to be removed, use isEmailConfirmed instead" + ) + icon: Image + + # A globally unique ID. id: ID! - labelUrl: String - pickupEnd( - format: String + identityVerified: Boolean + @deprecated( + reason: "identityVerified is going to be removed, use isIdentityVerified instead" + ) + initials(length: Int = 3): String + institutionalAffiliations: String + intents: [String] - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String - pickupStart( + # A type-specific ID likely used as a database ID. + internalID: ID! + isActiveBidder: Boolean + isActiveInquirer: Boolean + isEmailConfirmed: Boolean + isIdentityVerified: Boolean + isProfileComplete: Boolean + location: MyLocation + loyaltyApplicantAt( format: String # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See @@ -5882,184 +4012,53 @@ type CommerceShipment { # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String - pickupWindowModifier: String - priceCents: Int! - priceCurrency: String! - status: String - trackingNumber: String - trackingUrl: String - updatedAt( - format: String - - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String! -} - -enum CommerceShippingAddressVerifiedByEnum { - # Address was verified by ARTSY - ARTSY - - # Address was verified by the user - USER -} - -# Shipping information -input CommerceShippingAttributes { - addressLine1: String - addressLine2: String - city: String - country: String name: String - phoneNumber: String - postalCode: String - region: String -} -# Shipping contact information -input CommerceShippingContactAttributes { - email: String! - name: String! - phone: String! -} + # Collector's position with relevant institutions + otherRelevantPositions: String -# A shipping quote -type CommerceShippingQuote { - createdAt( + # User ID of the collector profile's owner + ownerID: ID! + privacy: String + profession: String + professionalBuyerAppliedAt( format: String # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See # http://www.iana.org/time-zones, # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String - ): String! - currencyCode: String! - displayName: String! - id: ID! - isSelected: Boolean! - name: String - price( - decimal: String = "." - - # Allows control of symbol position (%v = value, %s = symbol) - format: String = "%s%v" - precision: Int = 0 - symbol: String - thousand: String = "," ): String - priceCents: Int! - priceCurrency: String! - tier: String! - typeName: String! - updatedAt( + professionalBuyerAt( format: String # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See # http://www.iana.org/time-zones, # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String - ): String! + ): String + selfReportedPurchases: String + userInterests: [UserInterest]! } -# The connection type for ShippingQuote. -type CommerceShippingQuoteConnection { +# A connection to a list of items. +type CollectorProfileTypeConnection { # A list of edges. - edges: [CommerceShippingQuoteEdge] - - # A list of nodes. - nodes: [CommerceShippingQuote] + edges: [CollectorProfileTypeEdge] + pageCursors: PageCursors! # Information to aid in pagination. - pageInfo: CommercePageInfo! + pageInfo: PageInfo! + totalCount: Int } # An edge in a connection. -type CommerceShippingQuoteEdge { - # A cursor for use in pagination. +type CollectorProfileTypeEdge { + # A cursor for use in pagination cursor: String! - # The item at the end of the edge. - node: CommerceShippingQuote -} - -# Autogenerated input type of SubmitOrder -input CommerceSubmitOrderInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - id: ID! -} - -# Autogenerated return type of SubmitOrder. -type CommerceSubmitOrderPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SubmitOrderWithOffer -input CommerceSubmitOrderWithOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - confirmedSetupIntentId: String - offerId: ID! -} - -# Autogenerated return type of SubmitOrderWithOffer. -type CommerceSubmitOrderWithOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -# Autogenerated input type of SubmitPendingOffer -input CommerceSubmitPendingOfferInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - offerId: ID! -} - -# Autogenerated return type of SubmitPendingOffer. -type CommerceSubmitPendingOfferPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -enum CommerceTaxTypeEnum { - # U.S. sales tax. - SALES_TAX - - # Value-added tax. - VAT -} - -# Autogenerated input type of UpdateImpulseConversationId -input CommerceUpdateImpulseConversationIdInput { - # A unique identifier for the client performing the mutation. - clientMutationId: String - impulseConversationId: String! - orderId: ID! -} - -# Autogenerated return type of UpdateImpulseConversationId. -type CommerceUpdateImpulseConversationIdPayload { - # A unique identifier for the client performing the mutation. - clientMutationId: String - - # A union of success/failure - orderOrError: CommerceOrderOrFailureUnion! -} - -type CommerceUser { - id: String! + # The item at the end of the edge + node: CollectorProfileType } type ConditionReportRequest { @@ -7288,16 +5287,6 @@ type Conversation implements Node { last: Int sort: sort ): MessageConnection - orderConnection( - after: String - before: String - first: Int - last: Int - participantType: CommerceOrderParticipantEnum - sellerId: ID - state: CommerceOrderStateEnum - states: [CommerceOrderStateEnum!] - ): CommerceOrderConnectionWithTotalCount # The participant(s) responding to the conversation to: ConversationResponder! @@ -11901,7 +9890,7 @@ type Me implements Node { last: Int partnerId: String toBeReplied: Boolean - type: ConversationsInputMode = USER + type: ConversationsInputMode ): ConversationConnection counts: MeCounts createdAt( @@ -12114,16 +10103,6 @@ type Me implements Node { # The ID of the Notification id: String! ): Notification - orders( - after: String - before: String - first: Int - last: Int - mode: CommerceOrderModeEnum - sellerId: String - sort: CommerceOrderConnectionSortEnum - states: [CommerceOrderStateEnum!] - ): CommerceOrderConnectionWithTotalCount # Collector's position with relevant institutions otherRelevantPosition: String @@ -12554,176 +10533,6 @@ type Mutation { input: BulkUpdatePartnerArtworksMutationInput! ): BulkUpdatePartnerArtworksMutationPayload captureHold(input: CaptureHoldInput!): CaptureHoldPayload - - # Creates a pending offer on an pending order. - commerceAddInitialOfferToOrder( - # Parameters for AddInitialOfferToOrder - input: CommerceAddInitialOfferToOrderInput! - ): CommerceAddInitialOfferToOrderPayload - - # Approves an order. Different procedures will be done depending on the payment method. - # In general, approving an order will: debit the comission exemption; commit a - # tax transaction; capture a hold or charge the payment; book the shippment. - # If the payment method is asychronous, a pre-approval operation will be done instead. - commerceApproveOrder( - # Parameters for ApproveOrder - input: CommerceApproveOrderInput! - ): CommerceApproveOrderPayload - - # Allows the buyer to accept a seller's offer. - # Once the offer is accepted, the order will be effectively approved. - commerceBuyerAcceptOffer( - # Parameters for BuyerAcceptOffer - input: CommerceBuyerAcceptOfferInput! - ): CommerceBuyerAcceptOfferPayload - - # Creates a pending counter offer on an order. - commerceBuyerCounterOffer( - # Parameters for BuyerCounterOffer - input: CommerceBuyerCounterOfferInput! - ): CommerceBuyerCounterOfferPayload - - # Allows the buyer to reject a seller's offer. - # Once the offer is rejected, the order will be effectively cancelled. - commerceBuyerRejectOffer( - # Parameters for BuyerRejectOffer - input: CommerceBuyerRejectOfferInput! - ): CommerceBuyerRejectOfferPayload - - # Confirms the fulfillment of an order - commerceConfirmFulfillment( - # Parameters for ConfirmFulfillment - input: CommerceConfirmFulfillmentInput! - ): CommerceConfirmFulfillmentPayload - - # Confirms the pickup of an order - commerceConfirmPickup( - # Parameters for ConfirmPickup - input: CommerceConfirmPickupInput! - ): CommerceConfirmPickupPayload - - # Creates a bank debit setup intent in Stripe for a pending order. Also creates an internal Transaction record. - commerceCreateBankDebitSetupForOrder( - # Parameters for CreateBankDebitSetupForOrder - input: CommerceCreateBankDebitSetupForOrderInput! - ): CommerceCreateBankDebitSetupForOrderPayload - - # Creates an offer Order with inquiry as source. - commerceCreateInquiryOfferOrderWithArtwork( - # Parameters for CreateInquiryOfferOrderWithArtwork - input: CommerceCreateInquiryOfferOrderWithArtworkInput! - ): CommerceCreateInquiryOfferOrderWithArtworkPayload - - # Creates a buy Order with inquiry as source. - commerceCreateInquiryOrderWithArtwork( - # Parameters for CreateInquiryOrderWithArtwork - input: CommerceCreateInquiryOrderWithArtworkInput! - ): CommerceCreateInquiryOrderWithArtworkPayload - - # Creates an offer Order with artwork_page as source. - commerceCreateOfferOrderWithArtwork( - # Parameters for CreateOfferOrderWithArtwork - input: CommerceCreateOfferOrderWithArtworkInput! - ): CommerceCreateOfferOrderWithArtworkPayload - - # Creates a buy Order with artwork_page as source. - commerceCreateOrderWithArtwork( - # Parameters for CreateOrderWithArtwork - input: CommerceCreateOrderWithArtworkInput! - ): CommerceCreateOrderWithArtworkPayload - - # Creates a buy Order with partner_offer as source. - commerceCreatePartnerOfferOrder( - # Parameters for CreatePartnerOfferOrder - input: CommerceCreatePartnerOfferOrderInput! - ): CommerceCreatePartnerOfferOrderPayload - - # Fixes a failed payment. Essentially, it will update the credit card on the order and attempt to approve it again. - commerceFixFailedPayment( - # Parameters for FixFailedPayment - input: CommerceFixFailedPaymentInput! - ): CommerceFixFailedPaymentPayload - - # Fulfill an order with one Fulfillment, it sets this fulfillment to each line item in order - commerceFulfillAtOnce( - # Parameters for FulfillAtOnce - input: CommerceFulfillAtOnceInput! - ): CommerceFulfillAtOncePayload - - # Selects an ARTA shipping option for an order, updating the LineItem#selected_shipping_quote_id. - commerceSelectShippingOption( - # Parameters for SelectShippingOption - input: CommerceSelectShippingOptionInput! - ): CommerceSelectShippingOptionPayload - - # Accepts a buyer offer on an order from the seller perspective. This will essentially approve the order. - commerceSellerAcceptOffer( - # Parameters for SellerAcceptOffer - input: CommerceSellerAcceptOfferInput! - ): CommerceSellerAcceptOfferPayload - - # Seller accepts a provisional offer from buyer. - # It submits a counter offer back to the buyer to review, with final totals defined such as tax, shipping, etc. - commerceSellerAcceptProvisionalOffer( - # Parameters for SellerAcceptProvisionalOffer - input: CommerceSellerAcceptProvisionalOfferInput! - ): CommerceSellerAcceptProvisionalOfferPayload - - # Creates a seller counter offer. - commerceSellerCounterOffer( - # Parameters for SellerCounterOffer - input: CommerceSellerCounterOfferInput! - ): CommerceSellerCounterOfferPayload - - # Rejects a buyer offer on an order. This will essentially cancel the order. - commerceSellerRejectOffer( - # Parameters for SellerRejectOffer - input: CommerceSellerRejectOfferInput! - ): CommerceSellerRejectOfferPayload - - # Sets the payment method for an order. - commerceSetPayment( - # Parameters for SetPayment - input: CommerceSetPaymentInput! - ): CommerceSetPaymentPayload - - # Creates a Stripe payment intent for ACH payments. - commerceSetPaymentByStripeIntent( - # Parameters for SetPaymentByStripeIntent - input: CommerceSetPaymentByStripeIntentInput! - ): CommerceSetPaymentByStripeIntentPayload - - # Sets shipping information on an order based on the fulfillment type. - # Additionally, it recalculates and updates the order's total costs and tax values accordingly. - # If 'address_verified_by' is provided, a server side address verification will be performed accordingly. - commerceSetShipping( - # Parameters for SetShipping - input: CommerceSetShippingInput! - ): CommerceSetShippingPayload - - # Submits an order. If the order is from a private sale, it will also approve the order. - commerceSubmitOrder( - # Parameters for SubmitOrder - input: CommerceSubmitOrderInput! - ): CommerceSubmitOrderPayload - - # Submits an order with an offer. - commerceSubmitOrderWithOffer( - # Parameters for SubmitOrderWithOffer - input: CommerceSubmitOrderWithOfferInput! - ): CommerceSubmitOrderWithOfferPayload - - # Submits a pending offer. - commerceSubmitPendingOffer( - # Parameters for SubmitPendingOffer - input: CommerceSubmitPendingOfferInput! - ): CommerceSubmitPendingOfferPayload - - # Updates the value of impulse_conversation_id on an order - commerceUpdateImpulseConversationId( - # Parameters for UpdateImpulseConversationId - input: CommerceUpdateImpulseConversationIdInput! - ): CommerceUpdateImpulseConversationIdPayload confirmPassword(input: ConfirmPasswordInput!): ConfirmPasswordPayload # Create an account request @@ -12805,14 +10614,6 @@ type Mutation { input: CreateIdentityVerificationOverrideMutationInput! ): CreateIdentityVerificationOverrideMutationPayload createImage(input: CreateImageInput!): CreateImagePayload - createInquiryOfferOrder( - input: CommerceCreateInquiryOfferOrderWithArtworkInput! - ): CommerceCreateInquiryOfferOrderWithArtworkPayload - - # Creates an order and links the conversation to it - createInquiryOrder( - input: CommerceCreateInquiryOrderWithArtworkInput! - ): CommerceCreateInquiryOrderWithArtworkPayload # Creates an ordered set. createOrderedSet( @@ -13066,11 +10867,6 @@ type Mutation { submitInquiryRequestMutation( input: SubmitInquiryRequestMutationInput! ): SubmitInquiryRequestMutationPayload - - # Submits an OfferOrder and creates a conversation for it - submitOfferOrderWithConversation( - input: CommerceSubmitOrderWithOfferInput! - ): CommerceSubmitOrderWithOfferPayload transferMyCollection( input: TransferMyCollectionInput! ): TransferMyCollectionPayload @@ -15334,90 +13130,6 @@ type Query { term: String ): CollectorProfileTypeConnection - # Find balance of an account associated with a setup intent - commerceBankAccountBalance( - bankAccountId: ID - setupIntentId: ID - ): CommerceBankAccountBalance - - # Find list of competing orders - commerceCompetingOrders( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - orderId: ID! - ): CommerceOrderConnectionWithTotalCount - commerceLineItems( - # Returns the elements in the list that come after the specified cursor. - after: String - artworkId: String - - # Returns the elements in the list that come before the specified cursor. - before: String - editionSetId: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - orderStates: [CommerceOrderStateEnum!] - ): CommerceLineItemConnection - - # Return my orders - commerceMyOrders( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - mode: CommerceOrderModeEnum - sellerId: String - sort: CommerceOrderConnectionSortEnum - states: [CommerceOrderStateEnum!] - ): CommerceOrderConnectionWithTotalCount - - # Find an order by ID - commerceOrder(code: String, id: ID): CommerceOrder - - # Find list of orders - commerceOrders( - # Returns the elements in the list that come after the specified cursor. - after: String - - # Returns the elements in the list that come before the specified cursor. - before: String - buyerId: String - buyerType: String - - # Returns the first _n_ elements from the list. - first: Int - impulseConversationId: String - - # Returns the last _n_ elements from the list. - last: Int - mode: CommerceOrderModeEnum - sellerId: String - sellerType: String - sort: CommerceOrderConnectionSortEnum - state: CommerceOrderStateEnum - states: [CommerceOrderStateEnum!] - ): CommerceOrderConnectionWithTotalCount - # Sold or bought-in consignments consignments( # Returns the elements in the list that come after the specified cursor. @@ -15458,7 +13170,7 @@ type Query { last: Int partnerId: String toBeReplied: Boolean - type: ConversationsInputMode = USER + type: ConversationsInputMode ): ConversationConnection # A user's credit card @@ -15708,21 +13420,7 @@ type Query { before: String # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported - entities: [SearchEntity!] = [ - ARTICLE - ARTIST - ARTWORK - FAIR - FEATURE - GALLERY - GENE - INSTITUTION - PAGE - PROFILE - SALE - SHOW - TAG - ] + entities: [SearchEntity!] = [] first: Int last: Int @@ -17693,7 +15391,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { sort: ShowSorts # By default show only current shows - status: EventStatus = CURRENT + status: EventStatus ): ShowConnection # Alternate Markdown-supporting free text representation of the opening reception event’s date/time @@ -17844,6 +15542,7 @@ type ShowOpenedNotificationItem { } enum ShowSorts { + CREATED_AT_DESC END_AT_ASC END_AT_DESC FEATURED_ASC @@ -20126,7 +17825,7 @@ type Viewer { last: Int partnerId: String toBeReplied: Boolean - type: ConversationsInputMode = USER + type: ConversationsInputMode ): ConversationConnection # A user's credit card @@ -20366,21 +18065,7 @@ type Viewer { before: String # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported - entities: [SearchEntity!] = [ - ARTICLE - ARTIST - ARTWORK - FAIR - FEATURE - GALLERY - GENE - INSTITUTION - PAGE - PROFILE - SALE - SHOW - TAG - ] + entities: [SearchEntity!] = [] first: Int last: Int diff --git a/package.json b/package.json index be3adf55e1..51a3b2e2a1 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "graphql-middleware": "6.1.32", "graphql-parse-resolve-info": "^4.12.3", "graphql-relay": "0.7.0", - "graphql-tools": "4.0.8", + "graphql-tools": "5.0.0", "graphql-type-json": "0.1.4", "graphql-upload": "^13.0.0", "hot-shots": "5.6.1", diff --git a/src/index.ts b/src/index.ts index ff2a6dd28d..e3192b7b7a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,10 +17,6 @@ import { fetchLoggerRequestDone, } from "lib/loaders/api/extensionsLogger" import { info } from "./lib/loggers" -import { - executableExchangeSchema, - legacyTransformsForExchange, -} from "./lib/stitching/exchange/schema" import { middleware as requestIDsAdder, requestIPAddress, @@ -138,7 +134,7 @@ app.use( fetchPersistedQuery ) -const exchangeSchema = executableExchangeSchema(legacyTransformsForExchange) +const disableExchangeSchemaStitching = true const { graphqlHTTP } = require("express-graphql") const graphqlServer = graphqlHTTP((req, res, params) => { @@ -188,13 +184,22 @@ const graphqlServer = graphqlHTTP((req, res, params) => { defaultTimezone, ...loaders, // For stitching purposes - exchangeSchema, requestIDs, userAgent, appToken, ipAddress, xImpersonateUserID, } + if (!disableExchangeSchemaStitching) { + const { + executableExchangeSchema, + legacyTransformsForExchange, + } = require("./lib/stitching/exchange/schema") + + context.exchangeSchema = executableExchangeSchema( + legacyTransformsForExchange + ) + } const validationRules = [ principalFieldDirectiveValidation, diff --git a/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts b/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts index ea13a6811f..be69de082a 100644 --- a/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts +++ b/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts @@ -1,4 +1,4 @@ -import { Transform } from "graphql-tools" +import { Transform, VisitSchemaKind, visitSchema } from "graphql-tools" import { GraphQLSchema, GraphQLObjectType, @@ -10,11 +10,6 @@ import { isNamedType, isWrappingType, } from "graphql" -import { - visitSchema, - VisitSchemaKind, - TypeVisitor, -} from "graphql-tools/dist/transforms/visitSchema" import { createResolveType, fieldToFieldConfig, @@ -28,7 +23,7 @@ type TypeWithSelectableFields = export class ReplaceCommerceDateTimeType implements Transform { public transformSchema(schema: GraphQLSchema): GraphQLSchema { const newSchema = visitSchema(schema, { - [VisitSchemaKind.OBJECT_TYPE]: ((type: GraphQLObjectType) => { + [VisitSchemaKind.OBJECT_TYPE]: (type: GraphQLObjectType) => { const fields = this.transformFields(type) return ( fields && @@ -42,9 +37,9 @@ export class ReplaceCommerceDateTimeType implements Transform { interfaces: type.getInterfaces(), }) ) - }) as TypeVisitor, + }, - [VisitSchemaKind.INTERFACE_TYPE]: ((type: GraphQLInterfaceType) => { + [VisitSchemaKind.INTERFACE_TYPE]: (type: GraphQLInterfaceType) => { const fields = this.transformFields(type) return ( fields && @@ -57,7 +52,7 @@ export class ReplaceCommerceDateTimeType implements Transform { extensionASTNodes: type.extensionASTNodes, }) ) - }) as TypeVisitor, + }, }) return newSchema diff --git a/src/lib/stitching/mergeSchemas.ts b/src/lib/stitching/mergeSchemas.ts index 0b3d317bbc..eb9bcbfda3 100644 --- a/src/lib/stitching/mergeSchemas.ts +++ b/src/lib/stitching/mergeSchemas.ts @@ -2,10 +2,6 @@ import { mergeSchemas as _mergeSchemas } from "graphql-tools" import { executableGravitySchema } from "lib/stitching/gravity/schema" import { executableCausalitySchema } from "lib/stitching/causality/schema" import { executableConvectionSchema } from "lib/stitching/convection/schema" -import { - executableExchangeSchema, - transformsForExchange, -} from "lib/stitching/exchange/schema" import { executableDiffusionSchema } from "lib/stitching/diffusion/schema" import { executableVortexSchema } from "lib/stitching/vortex/schema" @@ -16,6 +12,8 @@ import { exchangeStitchingEnvironment as exchangeStitchingEnvironmentV2 } from " import { consignmentStitchingEnvironment as convectionStitchingEnvironmentV2 } from "./convection/v2/stitching" import { causalityStitchingEnvironment as causalityStitchingEnvironmentV2 } from "./causality/v2/stitching" +const disableExchangeSchemaStitching = true + /** * Incrementally merges in schemas according to `process.env` */ @@ -56,12 +54,18 @@ export const incrementalMergeSchemas = (localSchema) => { const diffusionSchema = executableDiffusionSchema() schemas.push(diffusionSchema) - const exchangeSchema = executableExchangeSchema(transformsForExchange) - schemas.push(exchangeSchema) + if (!disableExchangeSchemaStitching) { + const { + executableExchangeSchema, + } = require("./lib/stitching/exchange/schema") - useStitchingEnvironment( - exchangeStitchingEnvironmentV2({ localSchema, exchangeSchema }) - ) + const exchangeSchema = executableExchangeSchema(transformsForExchange) + schemas.push(exchangeSchema) + + useStitchingEnvironment( + exchangeStitchingEnvironmentV2({ localSchema, exchangeSchema }) + ) + } const convectionSchema = executableConvectionSchema() schemas.push(convectionSchema) diff --git a/src/schema/v2/Match.ts b/src/schema/v2/Match.ts index 548db5dac8..0569936e47 100644 --- a/src/schema/v2/Match.ts +++ b/src/schema/v2/Match.ts @@ -59,21 +59,9 @@ export const MatchConnection: GraphQLFieldConfig = { type: new GraphQLList(new GraphQLNonNull(SearchEntity)), description: "ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported", - defaultValue: [ - "ARTICLE", - "ARTIST", - "ARTWORK", - "FAIR", - "FEATURE", - "GALLERY", - "GENE", - "INSTITUTION", - "PAGE", - "PROFILE", - "SALE", - "SHOW", - "TAG", - ], + defaultValue: SearchEntity.getValues().map( + (entityEnum) => entityEnum.value + ), }, mode: { type: SearchMode, diff --git a/src/schema/v2/city/index.ts b/src/schema/v2/city/index.ts index 55a7847fc4..c578f17c3f 100644 --- a/src/schema/v2/city/index.ts +++ b/src/schema/v2/city/index.ts @@ -11,7 +11,9 @@ import { import { LatLngType } from "../location" import ShowSorts from "schema/v2/sorts/show_sorts" import FairSorts from "schema/v2/sorts/fair_sorts" -import EventStatus from "schema/v2/input_fields/event_status" +import EventStatus, { + EVENT_STATUS_SORTS_ENUMS, +} from "schema/v2/input_fields/event_status" import { pageable, CursorPageable } from "relay-cursor-paging" import { connectionFromArraySlice } from "graphql-relay" import { @@ -74,7 +76,7 @@ export const CityType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: EVENT_STATUS_SORTS_ENUMS.getValue("CURRENT")?.value, description: "Filter shows by chronological event status", }, partnerType: { diff --git a/src/schema/v2/conversation/conversations.ts b/src/schema/v2/conversation/conversations.ts index 429b018e87..80337765d8 100644 --- a/src/schema/v2/conversation/conversations.ts +++ b/src/schema/v2/conversation/conversations.ts @@ -72,7 +72,7 @@ const Conversations: GraphQLFieldConfig< }, type: { type: ConversationsInputModeEnum, - defaultValue: "USER", + defaultValue: ConversationsInputModeEnum.getValue("USER")?.value, }, toBeReplied: { type: GraphQLBoolean, diff --git a/src/schema/v2/fair.ts b/src/schema/v2/fair.ts index 85a2984dfb..c2010c999b 100644 --- a/src/schema/v2/fair.ts +++ b/src/schema/v2/fair.ts @@ -145,7 +145,7 @@ export const FairType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG")?.value, }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/input_fields/event_status.ts b/src/schema/v2/input_fields/event_status.ts index fc54cf832f..d986a8eb29 100644 --- a/src/schema/v2/input_fields/event_status.ts +++ b/src/schema/v2/input_fields/event_status.ts @@ -26,11 +26,13 @@ const EVENT_STATUS_SORTS = { }, } as const +export const EVENT_STATUS_SORTS_ENUMS = new GraphQLEnumType({ + name: "EventStatus", + values: EVENT_STATUS_SORTS, +}) + export const EventStatus = { - type: new GraphQLEnumType({ - name: "EventStatus", - values: EVENT_STATUS_SORTS, - }), + type: EVENT_STATUS_SORTS_ENUMS, } export type EventStatusType = keyof typeof EVENT_STATUS_SORTS diff --git a/src/schema/v2/me/showsByFollowedArtists.ts b/src/schema/v2/me/showsByFollowedArtists.ts index 2cc601bf71..9e5ce663ee 100644 --- a/src/schema/v2/me/showsByFollowedArtists.ts +++ b/src/schema/v2/me/showsByFollowedArtists.ts @@ -2,7 +2,9 @@ import { GraphQLFieldConfig } from "graphql" import { getPagingParameters, pageable } from "relay-cursor-paging" import { ResolverContext } from "types/graphql" import { connectionFromArraySlice } from "graphql-relay" -import EventStatus from "../input_fields/event_status" +import EventStatus, { + EVENT_STATUS_SORTS_ENUMS, +} from "../input_fields/event_status" import ShowSorts from "../sorts/show_sorts" import { ShowsConnection } from "../show" @@ -14,11 +16,11 @@ export const ShowsByFollowedArtists: GraphQLFieldConfig< args: pageable({ sort: { type: ShowSorts, - defaultValue: "-created_at", + defaultValue: ShowSorts.getValue("CREATED_AT_DESC")?.value, }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: EVENT_STATUS_SORTS_ENUMS.getValue("CURRENT")?.value, description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/me/showsConnection.ts b/src/schema/v2/me/showsConnection.ts index cc8c050f35..cb4f34a95c 100644 --- a/src/schema/v2/me/showsConnection.ts +++ b/src/schema/v2/me/showsConnection.ts @@ -3,7 +3,9 @@ import { getLocationArgs } from "lib/locationHelpers" import { getPagingParameters, pageable } from "relay-cursor-paging" import { ResolverContext } from "types/graphql" import { paginationResolver } from "../fields/pagination" -import EventStatus from "../input_fields/event_status" +import EventStatus, { + EVENT_STATUS_SORTS_ENUMS, +} from "../input_fields/event_status" import Near from "../input_fields/near" import { ShowsConnection as ShowsConnectionType } from "../show" import ShowSorts from "../sorts/show_sorts" @@ -28,11 +30,11 @@ export const ShowsConnection: GraphQLFieldConfig = { }, sort: { type: ShowSorts, - defaultValue: "-created_at", + defaultValue: ShowSorts.getValue("CREATED_AT_DESC")?.value, }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: EVENT_STATUS_SORTS_ENUMS.getValue("CURRENT")?.value, description: "Filter shows by chronological event status", }, }), diff --git a/src/schema/v2/partner/partner.ts b/src/schema/v2/partner/partner.ts index f5c52d26d3..7047c14f94 100644 --- a/src/schema/v2/partner/partner.ts +++ b/src/schema/v2/partner/partner.ts @@ -16,7 +16,9 @@ import cached from "schema/v2/fields/cached" import initials from "schema/v2/fields/initials" import Profile from "schema/v2/profile" import { locationsConnection, LocationType } from "schema/v2/location" -import EventStatus from "schema/v2/input_fields/event_status" +import EventStatus, { + EVENT_STATUS_SORTS_ENUMS, +} from "schema/v2/input_fields/event_status" import { NodeInterface, SlugAndInternalIDFields, @@ -776,7 +778,7 @@ export const PartnerType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "current", + defaultValue: EVENT_STATUS_SORTS_ENUMS.getValue("CURRENT")?.value, description: "Filter shows by chronological event status", }, isDisplayable: { diff --git a/src/schema/v2/show.ts b/src/schema/v2/show.ts index 08b6dad47b..2e5d4060c9 100644 --- a/src/schema/v2/show.ts +++ b/src/schema/v2/show.ts @@ -42,7 +42,9 @@ import { totalViaLoader } from "lib/total" import { find, flatten } from "lodash" import ShowSorts from "./sorts/show_sorts" -import EventStatus from "./input_fields/event_status" +import EventStatus, { + EVENT_STATUS_SORTS_ENUMS, +} from "./input_fields/event_status" import { LOCAL_DISCOVERY_RADIUS_KM } from "./city/constants" import { ResolverContext } from "types/graphql" import followArtistsResolver from "lib/shared_resolvers/followedArtistsResolver" @@ -343,7 +345,7 @@ export const ShowType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG")?.value, }, }, resolve: ({ start_at, end_at }, args) => { @@ -519,7 +521,7 @@ export const ShowType = new GraphQLObjectType({ }, status: { type: EventStatus.type, - defaultValue: "CURRENT", + defaultValue: EVENT_STATUS_SORTS_ENUMS.getValue("CURRENT")?.value, description: "By default show only current shows", }, discoverable: { diff --git a/src/schema/v2/show_event.ts b/src/schema/v2/show_event.ts index 0c39252ce6..8c08f28ae2 100644 --- a/src/schema/v2/show_event.ts +++ b/src/schema/v2/show_event.ts @@ -36,7 +36,7 @@ const ShowEventType = new GraphQLObjectType({ format: { type: ExhibitionPeriodFormatEnum, description: "Formatting option to apply to exhibition period", - defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG"), + defaultValue: ExhibitionPeriodFormatEnum.getValue("LONG")?.value, }, }, resolve: ({ start_at, end_at }, args) => { diff --git a/src/schema/v2/sorts/show_sorts.ts b/src/schema/v2/sorts/show_sorts.ts index e9b3a12a19..49b1677783 100644 --- a/src/schema/v2/sorts/show_sorts.ts +++ b/src/schema/v2/sorts/show_sorts.ts @@ -1,6 +1,7 @@ import { GraphQLEnumType } from "graphql" const SHOW_SORTS = { + CREATED_AT_DESC: { value: "-created_at" }, END_AT_ASC: { value: "end_at" }, END_AT_DESC: { value: "-end_at" }, FEATURED_ASC: { value: "featured" }, diff --git a/yarn.lock b/yarn.lock index 9378fd893a..b616f3b7ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1122,6 +1122,13 @@ dependencies: regenerator-runtime "^0.13.4" +"@babel/runtime@^7.9.2": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" + integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/template@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.14.5.tgz#a9bc9d8b33354ff6e55a9c60d1109200a68974f4" @@ -2600,7 +2607,7 @@ apollo-link-context@^1.0.20: apollo-link "^1.2.14" tslib "^1.9.3" -apollo-link-http-common@^0.2.16: +apollo-link-http-common@^0.2.14, apollo-link-http-common@^0.2.16: version "0.2.16" resolved "https://registry.yarnpkg.com/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz#756749dafc732792c8ca0923f9a40564b7c59ecc" integrity sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg== @@ -2618,7 +2625,7 @@ apollo-link-http@^1.5.17: apollo-link-http-common "^0.2.16" tslib "^1.9.3" -apollo-link@^1.2.14: +apollo-link@^1.2.12, apollo-link@^1.2.14: version "1.2.14" resolved "https://registry.yarnpkg.com/apollo-link/-/apollo-link-1.2.14.tgz#3feda4b47f9ebba7f4160bef8b977ba725b684d9" integrity sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg== @@ -2628,10 +2635,15 @@ apollo-link@^1.2.14: tslib "^1.9.3" zen-observable-ts "^0.8.21" -apollo-utilities@^1.0.1: - version "1.0.12" - resolved "https://registry.yarnpkg.com/apollo-utilities/-/apollo-utilities-1.0.12.tgz#9e2b2a34cf89f3bf0d73a664effd8c1bb5d1b7f7" - integrity sha512-3mSen+NLouRwhmzCSHbMICfLBa6J+QJOc+M8zzLyo10jAYsOK+A2VgR63q4mcQJmAp8LumC5VAyah1zw6enMcg== +apollo-upload-client@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/apollo-upload-client/-/apollo-upload-client-13.0.0.tgz#146d1ddd85d711fcac8ca97a72d3ca6787f2b71b" + integrity sha512-lJ9/bk1BH1lD15WhWRha2J3+LrXrPIX5LP5EwiOUHv8PCORp4EUrcujrA3rI5hZeZygrTX8bshcuMdpqpSrvtA== + dependencies: + "@babel/runtime" "^7.9.2" + apollo-link "^1.2.12" + apollo-link-http-common "^0.2.14" + extract-files "^8.0.0" apollo-utilities@^1.3.0: version "1.3.2" @@ -4528,6 +4540,11 @@ extract-files@^5.0.1: resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-5.0.1.tgz#c9492a8410be643e260a376f0151361993d5f659" integrity sha512-qRW6y9eKF0VbCyOoOEtFhzJ3uykAw8GKwQVXyAIqwocyEWW4m+v+evec34RwtUkkxxHh7NKBLJ6AnXM8W4dH5w== +extract-files@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/extract-files/-/extract-files-8.1.0.tgz#46a0690d0fe77411a2e3804852adeaa65cd59288" + integrity sha512-PTGtfthZK79WUMk+avLmwx3NGdU8+iVFXC2NMGxKsn0MnihOG2lvumj+AZo8CTwTrwjXDgZ5tztbRlEdRjBonQ== + extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" @@ -5092,16 +5109,19 @@ graphql-relay@0.7.0: resolved "https://registry.yarnpkg.com/graphql-relay/-/graphql-relay-0.7.0.tgz#e5c7a4bb52ede09e90e92dfd7b89d5947362278b" integrity sha512-P8eS3IbZRhbfbcfud1Q6VPrIru4hchkb15MuOij+WQo9r0chD5NBIxiVjuRE2iG2EMHxIOrZb8LnMe82+YdITA== -graphql-tools@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-4.0.8.tgz#e7fb9f0d43408fb0878ba66b522ce871bafe9d30" - integrity sha512-MW+ioleBrwhRjalKjYaLQbr+920pHBgy9vM/n47sswtns8+96sRn5M/G+J1eu7IMeKWiN/9p6tmwCHU7552VJg== +graphql-tools@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/graphql-tools/-/graphql-tools-5.0.0.tgz#67281c834a0e29f458adba8018f424816fa627e9" + integrity sha512-5zn3vtn//382b7G3Wzz3d5q/sh+f7tVrnxeuhTMTJ7pWJijNqLxH7VEzv8VwXCq19zAzHYEosFHfXiK7qzvk7w== dependencies: apollo-link "^1.2.14" - apollo-utilities "^1.0.1" + apollo-upload-client "^13.0.0" deprecated-decorator "^0.1.6" - iterall "^1.1.3" - uuid "^3.1.0" + form-data "^3.0.0" + iterall "^1.3.0" + node-fetch "^2.6.0" + tslib "^1.11.1" + uuid "^7.0.3" graphql-type-json@0.1.4: version "0.1.4" @@ -5884,10 +5904,10 @@ istanbul-reports@^2.2.6: dependencies: handlebars "^4.1.2" -iterall@^1.1.3: - version "1.2.2" - resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" - integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA== +iterall@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.3.0.tgz#afcb08492e2915cbd8a0884eb93a8c94d0d72fea" + integrity sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg== jackpot@>=0.0.6: version "0.0.6" @@ -7302,6 +7322,13 @@ node-fetch@^2.3.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@^2.6.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + node-gyp-build@^3.8.0: version "3.9.0" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.9.0.tgz#53a350187dd4d5276750da21605d1cb681d09e25" @@ -8321,6 +8348,11 @@ regenerator-runtime@^0.13.9: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + regenerator-transform@^0.14.2: version "0.14.5" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" @@ -9440,6 +9472,11 @@ tslib@^1.10.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043" integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q== +tslib@^1.11.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^1.8.1: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" @@ -9663,7 +9700,7 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@3.1.0, uuid@^3.1.0: +uuid@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" integrity sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g== @@ -9673,6 +9710,11 @@ uuid@^3.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +uuid@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" + integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== + uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" From 00ee409b406690ef63380c1e5e04c48125d388fc Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 11:50:30 +0100 Subject: [PATCH 15/26] chore: disable exchange schema stitching --- src/config.ts | 2 ++ src/index.ts | 5 ++--- src/lib/stitching/mergeSchemas.ts | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/config.ts b/src/config.ts index ba8bae56f9..729830d299 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,6 +25,7 @@ const { DIFFUSION_REQUEST_THROTTLE_MS, IPBASE_REQUEST_THROTTLE_MS, DIFFUSION_TOKEN, + DISABLE_EXCHANGE_SCHEMA_STITCHING, DISABLE_SCHEMA_STITCHING, EMBEDLY_ENDPOINT, EMBEDLY_KEY, @@ -155,6 +156,7 @@ export default { DIFFUSION_REQUEST_THROTTLE_MS: Number(DIFFUSION_REQUEST_THROTTLE_MS) || 600000, // 5 minutes IPBASE_REQUEST_THROTTLE_MS: Number(IPBASE_REQUEST_THROTTLE_MS) || 600000, // 5 minutes + DISABLE_EXCHANGE_SCHEMA_STITCHING, DISABLE_SCHEMA_STITCHING, EMBEDLY_ENDPOINT, EMBEDLY_KEY, diff --git a/src/index.ts b/src/index.ts index e3192b7b7a..fba1654113 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,6 +36,7 @@ import * as Sentry from "@sentry/node" import { bodyParserMiddleware } from "lib/bodyParserMiddleware" const { + DISABLE_EXCHANGE_SCHEMA_STITCHING, ENABLE_GRAPHQL_UPLOAD, ENABLE_REQUEST_LOGGING, GRAPHQL_UPLOAD_MAX_FILE_SIZE_IN_BYTES, @@ -134,8 +135,6 @@ app.use( fetchPersistedQuery ) -const disableExchangeSchemaStitching = true - const { graphqlHTTP } = require("express-graphql") const graphqlServer = graphqlHTTP((req, res, params) => { const accessToken = req.headers["x-access-token"] as string | undefined @@ -190,7 +189,7 @@ const graphqlServer = graphqlHTTP((req, res, params) => { ipAddress, xImpersonateUserID, } - if (!disableExchangeSchemaStitching) { + if (!DISABLE_EXCHANGE_SCHEMA_STITCHING) { const { executableExchangeSchema, legacyTransformsForExchange, diff --git a/src/lib/stitching/mergeSchemas.ts b/src/lib/stitching/mergeSchemas.ts index eb9bcbfda3..28fd61d7f4 100644 --- a/src/lib/stitching/mergeSchemas.ts +++ b/src/lib/stitching/mergeSchemas.ts @@ -11,8 +11,9 @@ import { gravityStitchingEnvironment as gravityStitchingEnvironmentV2 } from "./ import { exchangeStitchingEnvironment as exchangeStitchingEnvironmentV2 } from "./exchange/v2/stitching" import { consignmentStitchingEnvironment as convectionStitchingEnvironmentV2 } from "./convection/v2/stitching" import { causalityStitchingEnvironment as causalityStitchingEnvironmentV2 } from "./causality/v2/stitching" +import config from "config" -const disableExchangeSchemaStitching = true +const { DISABLE_EXCHANGE_SCHEMA_STITCHING } = config /** * Incrementally merges in schemas according to `process.env` @@ -54,9 +55,10 @@ export const incrementalMergeSchemas = (localSchema) => { const diffusionSchema = executableDiffusionSchema() schemas.push(diffusionSchema) - if (!disableExchangeSchemaStitching) { + if (!DISABLE_EXCHANGE_SCHEMA_STITCHING) { const { executableExchangeSchema, + transformsForExchange, } = require("./lib/stitching/exchange/schema") const exchangeSchema = executableExchangeSchema(transformsForExchange) From baf748f924fe220c168a983c3401635c065cbfd5 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 14:02:25 +0100 Subject: [PATCH 16/26] =?UTF-8?q?feat:=20get=20exchange=20stitching=20to?= =?UTF-8?q?=20work=20again=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _schemaV2.graphql | 2211 +++++++++++++++++ src/config.ts | 2 - src/index.ts | 18 +- src/lib/stitching/exchange/schema.ts | 13 +- .../replaceCommerceDateTimeType.ts | 126 +- src/lib/stitching/mergeSchemas.ts | 24 +- 6 files changed, 2258 insertions(+), 136 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index cd2cf7ac96..13f12ac030 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -4061,6 +4061,1930 @@ type CollectorProfileTypeEdge { node: CollectorProfileType } +# Represents either an action or a potential failure +union CommerceActionOrFailureUnion = + CommerceOrderRequiresAction + | CommerceOrderWithMutationFailure + +# Autogenerated input type of AddInitialOfferToOrder +input CommerceAddInitialOfferToOrderInput { + amountCents: Int! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + note: String + orderId: ID! +} + +# Autogenerated return type of AddInitialOfferToOrder. +type CommerceAddInitialOfferToOrderPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# An generic error type for mutations +type CommerceApplicationError { + # Code of this error + code: String! + + # What caused the error + data: String + + # Type of this error + type: String! +} + +# Autogenerated input type of ApproveOrder +input CommerceApproveOrderInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! + shippingContact: CommerceShippingContactAttributes +} + +# Autogenerated return type of ApproveOrder. +type CommerceApproveOrderPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Bank account balance +type CommerceBankAccountBalance { + balanceCents: Int + currencyCode: String +} + +type CommerceBuyOrder implements CommerceOrder { + # Whether Artsy collects taxes (e.g., sales tax or VAT) on this order. + artsyCollectsTaxes: Boolean + artsyRemitsTaxes: Boolean + artsyTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + artsyTotalCents: Int + artworkDetails: String + availablePaymentMethods: [CommercePaymentMethodEnum!]! + bankAccountId: String + buyer: CommerceOrderPartyUnion! + buyerDetails: OrderParty + buyerPhoneNumber: String + buyerPhoneNumberCountryCode: String + buyerProfile: CollectorProfileType + buyerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + buyerTotalCents: Int + code: String! + commissionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + commissionFeeCents: Int + commissionRate: Float + conditionsOfSale: String + conversation: Conversation + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + creditCard: CreditCard + creditCardId: String + currencyCode: String! + displayCommissionRate: String + displayState: CommerceOrderDisplayStateEnum! + id: ID! + impulseConversationId: String + internalID: ID! + itemsTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + + # Item total in cents, for Offer Orders this field reflects current offer + itemsTotalCents: Int + lastApprovedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + lastSubmittedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + lastTransactionFailed: Boolean + lineItems( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + ): CommerceLineItemConnection + mode: CommerceOrderModeEnum + orderHistory: [CommerceOrderEventUnion!]! + orderUpdateState: String + paymentMethod: CommercePaymentMethodEnum + paymentMethodDetails: PaymentMethodUnion + requestedFulfillment: CommerceRequestedFulfillmentUnion + + # Whether the buyer needs to complete identity verification to make this purchase. + requireIdentityVerification: Boolean! + seller: CommerceOrderPartyUnion! + sellerDetails: OrderParty + sellerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + sellerTotalCents: Int + shippingRadius: String + shippingTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + shippingTotalCents: Int + source: CommerceOrderSourceEnum! + state: CommerceOrderStateEnum! + stateExpiresAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + stateReason: String + stateUpdatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + taxTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + taxTotalCents: Int + taxTypes: [CommerceTaxTypeEnum!]! + totalListPrice( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + totalListPriceCents: Int! + transactionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + transactionFeeCents: Int + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +# Autogenerated input type of BuyerAcceptOffer +input CommerceBuyerAcceptOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + offerId: ID! +} + +# Autogenerated return type of BuyerAcceptOffer. +type CommerceBuyerAcceptOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of BuyerCounterOffer +input CommerceBuyerCounterOfferInput { + amountCents: Int! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + note: String + offerId: ID! +} + +# Autogenerated return type of BuyerCounterOffer. +type CommerceBuyerCounterOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +enum CommerceBuyerOfferActionEnum { + # Buyer's offer is accepted and final + OFFER_ACCEPTED + + # Buyer's offer accepted, needs to confirm tax and shipping + OFFER_ACCEPTED_CONFIRM_NEEDED + + # Buyer received a counter offer + OFFER_RECEIVED + + # Buyer received a counter, offer needs to confirm tax and shipping + OFFER_RECEIVED_CONFIRM_NEEDED + + # Buyer's payment failed + PAYMENT_FAILED + + # Provisional offer is accepted and tax/shipping confirmed + PROVISIONAL_OFFER_ACCEPTED +} + +# Autogenerated input type of BuyerRejectOffer +input CommerceBuyerRejectOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + offerId: ID! + rejectReason: CommerceCancelReasonTypeEnum +} + +# Autogenerated return type of BuyerRejectOffer. +type CommerceBuyerRejectOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +enum CommerceCancelReasonTypeEnum { + # cancelation reason is: admin_canceled + ADMIN_CANCELED + + # cancelation reason is: admin_failed_review + ADMIN_FAILED_REVIEW + + # cancelation reason is: buyer_lapsed + BUYER_LAPSED + + # cancelation reason is: buyer_rejected + BUYER_REJECTED + + # cancelation reason is: funds_not_received + FUNDS_NOT_RECEIVED + + # cancelation reason is: seller_lapsed + SELLER_LAPSED + + # cancelation reason is: seller_rejected + SELLER_REJECTED + + # cancelation reason is: seller_rejected_artwork_unavailable + SELLER_REJECTED_ARTWORK_UNAVAILABLE + + # cancelation reason is: seller_rejected_offer_too_low + SELLER_REJECTED_OFFER_TOO_LOW + + # cancelation reason is: seller_rejected_other + SELLER_REJECTED_OTHER + + # cancelation reason is: seller_rejected_shipping_unavailable + SELLER_REJECTED_SHIPPING_UNAVAILABLE +} + +# Autogenerated input type of ConfirmFulfillment +input CommerceConfirmFulfillmentInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! +} + +# Autogenerated return type of ConfirmFulfillment. +type CommerceConfirmFulfillmentPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of ConfirmPickup +input CommerceConfirmPickupInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! +} + +# Autogenerated return type of ConfirmPickup. +type CommerceConfirmPickupPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of CreateBankDebitSetupForOrder +input CommerceCreateBankDebitSetupForOrderInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! +} + +# Autogenerated return type of CreateBankDebitSetupForOrder. +type CommerceCreateBankDebitSetupForOrderPayload { + # A union of action data and failure + actionOrError: CommerceActionOrFailureUnion! + + # A unique identifier for the client performing the mutation. + clientMutationId: String +} + +# Autogenerated input type of CreateInquiryOfferOrderWithArtwork +input CommerceCreateInquiryOfferOrderWithArtworkInput { + # Artwork Id + artworkId: String! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # EditionSet Id + editionSetId: String + + # When set to false, we will create a new order. Otherwise if current user has + # submitted orders on same artwork/edition with same quantity, we will return that + findActiveOrCreate: Boolean = true + + # Impulse conversation id corresponding to an order. + impulseConversationId: String! + + # Number of items in the line item, default is 1 + quantity: Int +} + +# Autogenerated return type of CreateInquiryOfferOrderWithArtwork. +type CommerceCreateInquiryOfferOrderWithArtworkPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure. If find_active_or_create is not false, it will + # return existing submitted order for current user if exists, otherwise it will + # return newly created order + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of CreateInquiryOrderWithArtwork +input CommerceCreateInquiryOrderWithArtworkInput { + # Artwork Id + artworkId: String! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # EditionSet Id + editionSetId: String + + # Impulse conversation id corresponding to an order. + impulseConversationId: String! + + # Number of items in the line item + quantity: Int +} + +# Autogenerated return type of CreateInquiryOrderWithArtwork. +type CommerceCreateInquiryOrderWithArtworkPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of CreateOfferOrderWithArtwork +input CommerceCreateOfferOrderWithArtworkInput { + # Artwork Id + artworkId: String! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # EditionSet Id + editionSetId: String + + # When set to false, we will create a new order. Otherwise if current user has + # submitted orders on same artwork/edition with same quantity, we will return that + findActiveOrCreate: Boolean = true + + # Number of items in the line item, default is 1 + quantity: Int +} + +# Autogenerated return type of CreateOfferOrderWithArtwork. +type CommerceCreateOfferOrderWithArtworkPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure. If find_active_or_create is not false, it will + # return existing submitted order for current user if exists, otherwise it will + # return newly created order + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of CreateOrderWithArtwork +input CommerceCreateOrderWithArtworkInput { + # Artwork Id + artworkId: String! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # EditionSet Id + editionSetId: String + + # Number of items in the line item + quantity: Int +} + +# Autogenerated return type of CreateOrderWithArtwork. +type CommerceCreateOrderWithArtworkPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of CreatePartnerOfferOrderWithArtwork +input CommerceCreatePartnerOfferOrderWithArtworkInput { + # Artwork Id + artworkId: String! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # EditionSet Id + editionSetId: String + + # PartnerOffer Id + partnerOfferId: String! + + # Number of items in the line item + quantity: Int +} + +# Autogenerated return type of CreatePartnerOfferOrderWithArtwork. +type CommerceCreatePartnerOfferOrderWithArtworkPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Date in YYYY-MM-DD format +scalar CommerceDate + +# An ISO 8601 datetime +scalar CommerceDateTime + +enum CommerceEeiFormStatusEnum { + # approved + APPROVED + + # cleared + CLEARED + + # pending + PENDING + + # rejected + REJECTED + + # submitted + SUBMITTED +} + +interface CommerceEventInterface { + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +# Autogenerated input type of FixFailedPayment +input CommerceFixFailedPaymentInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + creditCardId: String! + offerId: ID + orderId: ID +} + +# Autogenerated return type of FixFailedPayment. +type CommerceFixFailedPaymentPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of FulfillAtOnce +input CommerceFulfillAtOnceInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + fulfillment: CommerceFulfillmentAttributes! + id: ID! +} + +# Autogenerated return type of FulfillAtOnce. +type CommerceFulfillAtOncePayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# A Fulfillment for an order +type CommerceFulfillment { + courier: String! + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + estimatedDelivery: CommerceDate + id: ID! + internalID: ID! + notes: String + trackingId: String + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +# Attributes of a Fulfillment +input CommerceFulfillmentAttributes { + courier: String! + estimatedDelivery: CommerceDate + notes: String + trackingId: String +} + +# The connection type for Fulfillment. +type CommerceFulfillmentConnection { + # A list of edges. + edges: [CommerceFulfillmentEdge] + + # A list of nodes. + nodes: [CommerceFulfillment] + + # Information to aid in pagination. + pageInfo: CommercePageInfo! +} + +# An edge in a connection. +type CommerceFulfillmentEdge { + # A cursor for use in pagination. + cursor: String! + + # The item at the end of the edge. + node: CommerceFulfillment +} + +# A Line Item +type CommerceLineItem { + artwork: Artwork + artworkId: String! + artworkOrEditionSet: ArtworkOrEditionSetType + artworkVersion: ArtworkVersion + artworkVersionId: String! + commissionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + commissionFeeCents: Int + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + editionSetId: String + fulfillments( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + ): CommerceFulfillmentConnection + id: ID! + internalID: ID! + listPrice( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + listPriceCents: Int! + order: CommerceOrder! + priceCents: Int! @deprecated(reason: "switch to use listPriceCents") + quantity: Int! + selectedShippingQuote: CommerceShippingQuote + shipment: CommerceShipment + shippingQuoteOptions( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + ): CommerceShippingQuoteConnection + shippingTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + shippingTotalCents: Int + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +# The connection type for LineItem. +type CommerceLineItemConnection { + # A list of edges. + edges: [CommerceLineItemEdge] + + # A list of nodes. + nodes: [CommerceLineItem] + + # Information to aid in pagination. + pageInfo: CommercePageInfo! +} + +# An edge in a connection. +type CommerceLineItemEdge { + # A cursor for use in pagination. + cursor: String! + + # The item at the end of the edge. + node: CommerceLineItem +} + +# An Offer +type CommerceOffer { + amount( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + amountCents: Int! + buyerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + buyerTotalCents: Int + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + creatorId: String! + currencyCode: String! + + # True when this offer fills in the missing fees from the previous one + definesTotal: Boolean! + from: CommerceOrderPartyUnion! + fromDetails: OrderParty + fromParticipant: CommerceOrderParticipantEnum + + # True when a all the fees (shipping/tax) were calculated for the offer + hasDefiniteTotal: Boolean! + id: ID! + internalID: ID! + note: String + + # Only false when previous offer has the same amount. + offerAmountChanged: Boolean! + order: CommerceOrder! + respondsTo: CommerceOffer + shippingTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + shippingTotalCents: Int + submittedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + taxTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + taxTotalCents: Int +} + +# The connection type for Offer. +type CommerceOfferConnection { + # A list of edges. + edges: [CommerceOfferEdge] + + # A list of nodes. + nodes: [CommerceOffer] + + # Information to aid in pagination. + pageInfo: CommercePageInfo! +} + +# An edge in a connection. +type CommerceOfferEdge { + # A cursor for use in pagination. + cursor: String! + + # The item at the end of the edge. + node: CommerceOffer +} + +type CommerceOfferOrder implements CommerceOrder { + # Whether Artsy collects taxes (e.g., sales tax or VAT) on this order. + artsyCollectsTaxes: Boolean + artsyRemitsTaxes: Boolean + artsyTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + artsyTotalCents: Int + artworkDetails: String + availablePaymentMethods: [CommercePaymentMethodEnum!]! + awaitingResponseFrom: CommerceOrderParticipantEnum + bankAccountId: String + buyer: CommerceOrderPartyUnion! + + # Type of action buyer needs to perform in response to the offer + buyerAction: CommerceBuyerOfferActionEnum + buyerDetails: OrderParty + buyerPhoneNumber: String + buyerPhoneNumberCountryCode: String + buyerProfile: CollectorProfileType + buyerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + buyerTotalCents: Int + code: String! + commissionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + commissionFeeCents: Int + commissionRate: Float + conditionsOfSale: String + conversation: Conversation + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + creditCard: CreditCard + creditCardId: String + currencyCode: String! + displayCommissionRate: String + displayState: CommerceOrderDisplayStateEnum! + id: ID! + impulseConversationId: String + internalID: ID! + isInquiryOrder: Boolean! + itemsTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + + # Item total in cents, for Offer Orders this field reflects current offer + itemsTotalCents: Int + lastApprovedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + + # Last submitted offer + lastOffer: CommerceOffer + lastSubmittedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + lastTransactionFailed: Boolean + lineItems( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + ): CommerceLineItemConnection + mode: CommerceOrderModeEnum + myLastOffer: CommerceOffer + offerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + offers( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + fromId: String + fromType: String + + # Returns the last _n_ elements from the list. + last: Int + ): CommerceOfferConnection + orderHistory: [CommerceOrderEventUnion!]! + orderUpdateState: String + paymentMethod: CommercePaymentMethodEnum + paymentMethodDetails: PaymentMethodUnion + requestedFulfillment: CommerceRequestedFulfillmentUnion + + # Whether the buyer needs to complete identity verification to make this purchase. + requireIdentityVerification: Boolean! + seller: CommerceOrderPartyUnion! + sellerDetails: OrderParty + sellerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + sellerTotalCents: Int + shippingRadius: String + shippingTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + shippingTotalCents: Int + source: CommerceOrderSourceEnum! + state: CommerceOrderStateEnum! + stateExpiresAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + stateReason: String + stateUpdatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + taxTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + taxTotalCents: Int + taxTypes: [CommerceTaxTypeEnum!]! + totalListPrice( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + totalListPriceCents: Int! + transactionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + transactionFeeCents: Int + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +type CommerceOfferSubmittedEvent implements CommerceEventInterface { + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + offer: CommerceOffer! +} + +# Order +interface CommerceOrder { + # Whether Artsy collects taxes (e.g., sales tax or VAT) on this order. + artsyCollectsTaxes: Boolean + artsyRemitsTaxes: Boolean + artsyTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + artsyTotalCents: Int + artworkDetails: String + availablePaymentMethods: [CommercePaymentMethodEnum!]! + bankAccountId: String + buyer: CommerceOrderPartyUnion! + buyerDetails: OrderParty + buyerPhoneNumber: String + buyerPhoneNumberCountryCode: String + buyerProfile: CollectorProfileType + buyerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + buyerTotalCents: Int + code: String! + commissionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + commissionFeeCents: Int + commissionRate: Float + conditionsOfSale: String + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + creditCard: CreditCard + creditCardId: String + currencyCode: String! + displayCommissionRate: String + displayState: CommerceOrderDisplayStateEnum! + id: ID! + impulseConversationId: String + internalID: ID! + itemsTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + + # Item total in cents, for Offer Orders this field reflects current offer + itemsTotalCents: Int + lastApprovedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + lastSubmittedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + lastTransactionFailed: Boolean + lineItems( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + ): CommerceLineItemConnection + mode: CommerceOrderModeEnum + orderHistory: [CommerceOrderEventUnion!]! + orderUpdateState: String + paymentMethod: CommercePaymentMethodEnum + paymentMethodDetails: PaymentMethodUnion + requestedFulfillment: CommerceRequestedFulfillmentUnion + + # Whether the buyer needs to complete identity verification to make this purchase. + requireIdentityVerification: Boolean! + seller: CommerceOrderPartyUnion! + sellerDetails: OrderParty + sellerTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + sellerTotalCents: Int + shippingRadius: String + shippingTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + shippingTotalCents: Int + source: CommerceOrderSourceEnum! + state: CommerceOrderStateEnum! + stateExpiresAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + stateReason: String + stateUpdatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + taxTotal( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + taxTotalCents: Int + taxTypes: [CommerceTaxTypeEnum!]! + totalListPrice( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + totalListPriceCents: Int! + transactionFee( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + transactionFeeCents: Int + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +# Order Action data +type CommerceOrderActionData { + clientSecret: String! +} + +# Fields to sort by +enum CommerceOrderConnectionSortEnum { + # Sort by the timestamp the state of the order expires at in ascending order + STATE_EXPIRES_AT_ASC + + # Sort by the timestamp the state of the order expires at in descending order + STATE_EXPIRES_AT_DESC + + # Sort by the timestamp the state of order was last updated in ascending order + STATE_UPDATED_AT_ASC + + # Sort by the timestamp the state of order was last updated in descending order + STATE_UPDATED_AT_DESC + + # Sort by the timestamp the order was last updated in ascending order + UPDATED_AT_ASC + + # Sort by the timestamp the order was last updated in descending order + UPDATED_AT_DESC +} + +# The connection type for Order. +type CommerceOrderConnectionWithTotalCount { + # A list of edges. + edges: [CommerceOrderEdge] + + # A list of nodes. + nodes: [CommerceOrder] + pageCursors: CommercePageCursors + + # Information to aid in pagination. + pageInfo: CommercePageInfo! + totalCount: Int + totalPages: Int +} + +enum CommerceOrderDisplayStateEnum { + # order is abandoned by buyer and never submitted + ABANDONED + + # order is approved by seller + APPROVED + + # order is canceled + CANCELED + + # order is fulfilled by seller + FULFILLED + + # order has been collected and is with shipper + IN_TRANSIT + + # order is still pending submission by buyer + PENDING + + # order is approved but not yet sent out + PROCESSING + + # order approval is processing and will be updated when complete + PROCESSING_APPROVAL + + # order is refunded after being approved or fulfilled + REFUNDED + + # order is submitted by buyer + SUBMITTED +} + +# An edge in a connection. +type CommerceOrderEdge { + # A cursor for use in pagination. + cursor: String! + + # The item at the end of the edge. + node: CommerceOrder +} + +# Represents either a state change or new offer +union CommerceOrderEventUnion = + CommerceOfferSubmittedEvent + | CommerceOrderStateChangedEvent + +enum CommerceOrderFulfillmentTypeEnum { + # fulfillment type is: pickup + PICKUP + + # fulfillment type is: ship + SHIP + + # fulfillment type is: ship_arta + SHIP_ARTA +} + +enum CommerceOrderModeEnum { + # Buy Order + BUY + + # Offer Order + OFFER +} + +# Represents either a resolved Order or a potential failure +union CommerceOrderOrFailureUnion = + CommerceOrderRequiresAction + | CommerceOrderWithMutationFailure + | CommerceOrderWithMutationSuccess + +enum CommerceOrderParticipantEnum { + # Participant on the buyer side + BUYER + + # Participant on the seller side + SELLER +} + +# Represents either a partner or a user +union CommerceOrderPartyUnion = CommercePartner | CommerceUser + +# Data reflecting actions required +type CommerceOrderRequiresAction { + # Data related to action needed + actionData: CommerceOrderActionData! +} + +enum CommerceOrderSourceEnum { + # The order was originated on the artwork page + artwork_page + + # The order was originated on a conversation + inquiry + + # The order was originated from a private sale + private_sale +} + +type CommerceOrderStateChangedEvent implements CommerceEventInterface { + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + orderUpdateState: String + state: CommerceOrderStateEnum! + stateReason: String +} + +enum CommerceOrderStateEnum { + # order is abandoned by buyer and never submitted + ABANDONED + + # order is approved by seller + APPROVED + + # order is canceled + CANCELED + + # order is fulfilled by seller + FULFILLED + + # order is undergoing review by Artsy admins + IN_REVIEW + + # order is still pending submission by buyer + PENDING + + # order approval is processing and will be updated when complete + PROCESSING_APPROVAL + + # order is refunded after being approved or fulfilled + REFUNDED + + # order is submitted by buyer + SUBMITTED +} + +# An error response for changes to an order +type CommerceOrderWithMutationFailure { + error: CommerceApplicationError! +} + +# A successfully returned order type +type CommerceOrderWithMutationSuccess { + order: CommerceOrder! +} + +type CommercePageCursor { + # first cursor on the page + cursor: String! + + # is this the current page? + isCurrent: Boolean! + + # page number out of totalPages + page: Int! +} + +type CommercePageCursors { + around: [CommercePageCursor!]! + + # optional, may be included in field around + first: CommercePageCursor + + # optional, may be included in field around + last: CommercePageCursor + previous: CommercePageCursor +} + +# Information about pagination in a connection. +type CommercePageInfo { + # When paginating forwards, the cursor to continue. + endCursor: String + + # When paginating forwards, are there more items? + hasNextPage: Boolean! + + # When paginating backwards, are there more items? + hasPreviousPage: Boolean! + + # When paginating backwards, the cursor to continue. + startCursor: String +} + +type CommercePartner { + id: String! + type: String! +} + +enum CommercePaymentMethodEnum { + # Credit Card + CREDIT_CARD + + # SEPA + SEPA_DEBIT + + # US Bank Account + US_BANK_ACCOUNT + + # Wire Transfer + WIRE_TRANSFER +} + +type CommercePickup { + fulfillmentType: String! + phoneNumber: String +} + +# Represents either a shipping information or pickup +union CommerceRequestedFulfillmentUnion = + CommercePickup + | CommerceShip + | CommerceShipArta + +# Autogenerated input type of SelectShippingOption +input CommerceSelectShippingOptionInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! + selectedShippingQuoteId: ID! +} + +# Autogenerated return type of SelectShippingOption. +type CommerceSelectShippingOptionPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SellerAcceptOffer +input CommerceSellerAcceptOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + offerId: ID! + shippingContact: CommerceShippingContactAttributes +} + +# Autogenerated return type of SellerAcceptOffer. +type CommerceSellerAcceptOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SellerAcceptProvisionalOffer +input CommerceSellerAcceptProvisionalOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # If location was set in the accept offer step + locationFilledOnOrder: Boolean + offerId: ID! + + # Shipping info belonging to this specific order. It overrides the defined shipping costs of the artwork. + shippingTotalCents: Int +} + +# Autogenerated return type of SellerAcceptProvisionalOffer. +type CommerceSellerAcceptProvisionalOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SellerCounterOffer +input CommerceSellerCounterOfferInput { + amountCents: Int! + + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # If location was set in the counter offer step + locationFilledOnOrder: Boolean + note: String + offerId: ID! + shippingContact: CommerceShippingContactAttributes + + # Shipping info belonging to this specific order. It overrides the defined shipping costs of the artwork. + shippingTotalCents: Int +} + +# Autogenerated return type of SellerCounterOffer. +type CommerceSellerCounterOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SellerRejectOffer +input CommerceSellerRejectOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + offerId: ID! + rejectReason: CommerceCancelReasonTypeEnum +} + +# Autogenerated return type of SellerRejectOffer. +type CommerceSellerRejectOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SetPaymentByStripeIntent +input CommerceSetPaymentByStripeIntentInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! + oneTimeUse: Boolean = false + setupIntentId: String! +} + +# Autogenerated return type of SetPaymentByStripeIntent. +type CommerceSetPaymentByStripeIntentPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SetPayment +input CommerceSetPaymentInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! + paymentMethod: CommercePaymentMethodEnum! + paymentMethodId: String +} + +# Autogenerated return type of SetPayment. +type CommerceSetPaymentPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SetShipping +input CommerceSetShippingInput { + addressVerifiedBy: CommerceShippingAddressVerifiedByEnum + + # A unique identifier for the client performing the mutation. + clientMutationId: String + fulfillmentType: CommerceOrderFulfillmentTypeEnum! + id: ID! + phoneNumber: String + phoneNumberCountryCode: String + shipping: CommerceShippingAttributes +} + +# Autogenerated return type of SetShipping. +type CommerceSetShippingPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +type CommerceShip { + addressLine1: String + addressLine2: String + city: String + country: String + name: String + phoneNumber: String + postalCode: String + region: String +} + +type CommerceShipArta { + addressLine1: String + addressLine2: String + city: String + country: String + name: String + phoneNumber: String + postalCode: String + region: String +} + +# A shipment +type CommerceShipment { + bookedAt: String + carrierName: String + contactEmail: String + contactName: String + contactPhone: String + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + deliveryEnd( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + deliveryStart( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + deliveryWindowModifier: String + eeiFormStatus: CommerceEeiFormStatusEnum + estimatedDeliveryWindow: String + estimatedPickupWindow: String + id: ID! + labelUrl: String + pickupEnd( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + pickupStart( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String + pickupWindowModifier: String + priceCents: Int! + priceCurrency: String! + status: String + trackingNumber: String + trackingUrl: String + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +enum CommerceShippingAddressVerifiedByEnum { + # Address was verified by ARTSY + ARTSY + + # Address was verified by the user + USER +} + +# Shipping information +input CommerceShippingAttributes { + addressLine1: String + addressLine2: String + city: String + country: String + name: String + phoneNumber: String + postalCode: String + region: String +} + +# Shipping contact information +input CommerceShippingContactAttributes { + email: String! + name: String! + phone: String! +} + +# A shipping quote +type CommerceShippingQuote { + createdAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! + currencyCode: String! + displayName: String! + id: ID! + isSelected: Boolean! + name: String + price( + decimal: String = "." + + # Allows control of symbol position (%v = value, %s = symbol) + format: String = "%s%v" + precision: Int = 0 + symbol: String + thousand: String = "," + ): String + priceCents: Int! + priceCurrency: String! + tier: String! + typeName: String! + updatedAt( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String! +} + +# The connection type for ShippingQuote. +type CommerceShippingQuoteConnection { + # A list of edges. + edges: [CommerceShippingQuoteEdge] + + # A list of nodes. + nodes: [CommerceShippingQuote] + + # Information to aid in pagination. + pageInfo: CommercePageInfo! +} + +# An edge in a connection. +type CommerceShippingQuoteEdge { + # A cursor for use in pagination. + cursor: String! + + # The item at the end of the edge. + node: CommerceShippingQuote +} + +# Autogenerated input type of SubmitOrder +input CommerceSubmitOrderInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + id: ID! +} + +# Autogenerated return type of SubmitOrder. +type CommerceSubmitOrderPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SubmitOrderWithOffer +input CommerceSubmitOrderWithOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + confirmedSetupIntentId: String + offerId: ID! +} + +# Autogenerated return type of SubmitOrderWithOffer. +type CommerceSubmitOrderWithOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +# Autogenerated input type of SubmitPendingOffer +input CommerceSubmitPendingOfferInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + offerId: ID! +} + +# Autogenerated return type of SubmitPendingOffer. +type CommerceSubmitPendingOfferPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +enum CommerceTaxTypeEnum { + # U.S. sales tax. + SALES_TAX + + # Value-added tax. + VAT +} + +# Autogenerated input type of UpdateImpulseConversationId +input CommerceUpdateImpulseConversationIdInput { + # A unique identifier for the client performing the mutation. + clientMutationId: String + impulseConversationId: String! + orderId: ID! +} + +# Autogenerated return type of UpdateImpulseConversationId. +type CommerceUpdateImpulseConversationIdPayload { + # A unique identifier for the client performing the mutation. + clientMutationId: String + + # A union of success/failure + orderOrError: CommerceOrderOrFailureUnion! +} + +type CommerceUser { + id: String! +} + type ConditionReportRequest { internalID: ID! saleArtworkID: ID @@ -5287,6 +7211,16 @@ type Conversation implements Node { last: Int sort: sort ): MessageConnection + orderConnection( + after: String + before: String + first: Int + last: Int + participantType: CommerceOrderParticipantEnum + sellerId: ID + state: CommerceOrderStateEnum + states: [CommerceOrderStateEnum!] + ): CommerceOrderConnectionWithTotalCount # The participant(s) responding to the conversation to: ConversationResponder! @@ -10103,6 +12037,16 @@ type Me implements Node { # The ID of the Notification id: String! ): Notification + orders( + after: String + before: String + first: Int + last: Int + mode: CommerceOrderModeEnum + sellerId: String + sort: CommerceOrderConnectionSortEnum + states: [CommerceOrderStateEnum!] + ): CommerceOrderConnectionWithTotalCount # Collector's position with relevant institutions otherRelevantPosition: String @@ -10533,6 +12477,176 @@ type Mutation { input: BulkUpdatePartnerArtworksMutationInput! ): BulkUpdatePartnerArtworksMutationPayload captureHold(input: CaptureHoldInput!): CaptureHoldPayload + + # Creates a pending offer on an pending order. + commerceAddInitialOfferToOrder( + # Parameters for AddInitialOfferToOrder + input: CommerceAddInitialOfferToOrderInput! + ): CommerceAddInitialOfferToOrderPayload + + # Approves an order. Different procedures will be done depending on the payment method. + # In general, approving an order will: debit the comission exemption; commit a + # tax transaction; capture a hold or charge the payment; book the shippment. + # If the payment method is asychronous, a pre-approval operation will be done instead. + commerceApproveOrder( + # Parameters for ApproveOrder + input: CommerceApproveOrderInput! + ): CommerceApproveOrderPayload + + # Allows the buyer to accept a seller's offer. + # Once the offer is accepted, the order will be effectively approved. + commerceBuyerAcceptOffer( + # Parameters for BuyerAcceptOffer + input: CommerceBuyerAcceptOfferInput! + ): CommerceBuyerAcceptOfferPayload + + # Creates a pending counter offer on an order. + commerceBuyerCounterOffer( + # Parameters for BuyerCounterOffer + input: CommerceBuyerCounterOfferInput! + ): CommerceBuyerCounterOfferPayload + + # Allows the buyer to reject a seller's offer. + # Once the offer is rejected, the order will be effectively cancelled. + commerceBuyerRejectOffer( + # Parameters for BuyerRejectOffer + input: CommerceBuyerRejectOfferInput! + ): CommerceBuyerRejectOfferPayload + + # Confirms the fulfillment of an order + commerceConfirmFulfillment( + # Parameters for ConfirmFulfillment + input: CommerceConfirmFulfillmentInput! + ): CommerceConfirmFulfillmentPayload + + # Confirms the pickup of an order + commerceConfirmPickup( + # Parameters for ConfirmPickup + input: CommerceConfirmPickupInput! + ): CommerceConfirmPickupPayload + + # Creates a bank debit setup intent in Stripe for a pending order. Also creates an internal Transaction record. + commerceCreateBankDebitSetupForOrder( + # Parameters for CreateBankDebitSetupForOrder + input: CommerceCreateBankDebitSetupForOrderInput! + ): CommerceCreateBankDebitSetupForOrderPayload + + # Creates an offer Order with inquiry as source. + commerceCreateInquiryOfferOrderWithArtwork( + # Parameters for CreateInquiryOfferOrderWithArtwork + input: CommerceCreateInquiryOfferOrderWithArtworkInput! + ): CommerceCreateInquiryOfferOrderWithArtworkPayload + + # Creates a buy Order with inquiry as source. + commerceCreateInquiryOrderWithArtwork( + # Parameters for CreateInquiryOrderWithArtwork + input: CommerceCreateInquiryOrderWithArtworkInput! + ): CommerceCreateInquiryOrderWithArtworkPayload + + # Creates an offer Order with artwork_page as source. + commerceCreateOfferOrderWithArtwork( + # Parameters for CreateOfferOrderWithArtwork + input: CommerceCreateOfferOrderWithArtworkInput! + ): CommerceCreateOfferOrderWithArtworkPayload + + # Creates a buy Order with artwork_page as source. + commerceCreateOrderWithArtwork( + # Parameters for CreateOrderWithArtwork + input: CommerceCreateOrderWithArtworkInput! + ): CommerceCreateOrderWithArtworkPayload + + # Creates a buy Order with partner_offer as source. + commerceCreatePartnerOfferOrderWithArtwork( + # Parameters for CreatePartnerOfferOrderWithArtwork + input: CommerceCreatePartnerOfferOrderWithArtworkInput! + ): CommerceCreatePartnerOfferOrderWithArtworkPayload + + # Fixes a failed payment. Essentially, it will update the credit card on the order and attempt to approve it again. + commerceFixFailedPayment( + # Parameters for FixFailedPayment + input: CommerceFixFailedPaymentInput! + ): CommerceFixFailedPaymentPayload + + # Fulfill an order with one Fulfillment, it sets this fulfillment to each line item in order + commerceFulfillAtOnce( + # Parameters for FulfillAtOnce + input: CommerceFulfillAtOnceInput! + ): CommerceFulfillAtOncePayload + + # Selects an ARTA shipping option for an order, updating the LineItem#selected_shipping_quote_id. + commerceSelectShippingOption( + # Parameters for SelectShippingOption + input: CommerceSelectShippingOptionInput! + ): CommerceSelectShippingOptionPayload + + # Accepts a buyer offer on an order from the seller perspective. This will essentially approve the order. + commerceSellerAcceptOffer( + # Parameters for SellerAcceptOffer + input: CommerceSellerAcceptOfferInput! + ): CommerceSellerAcceptOfferPayload + + # Seller accepts a provisional offer from buyer. + # It submits a counter offer back to the buyer to review, with final totals defined such as tax, shipping, etc. + commerceSellerAcceptProvisionalOffer( + # Parameters for SellerAcceptProvisionalOffer + input: CommerceSellerAcceptProvisionalOfferInput! + ): CommerceSellerAcceptProvisionalOfferPayload + + # Creates a seller counter offer. + commerceSellerCounterOffer( + # Parameters for SellerCounterOffer + input: CommerceSellerCounterOfferInput! + ): CommerceSellerCounterOfferPayload + + # Rejects a buyer offer on an order. This will essentially cancel the order. + commerceSellerRejectOffer( + # Parameters for SellerRejectOffer + input: CommerceSellerRejectOfferInput! + ): CommerceSellerRejectOfferPayload + + # Sets the payment method for an order. + commerceSetPayment( + # Parameters for SetPayment + input: CommerceSetPaymentInput! + ): CommerceSetPaymentPayload + + # Creates a Stripe payment intent for ACH payments. + commerceSetPaymentByStripeIntent( + # Parameters for SetPaymentByStripeIntent + input: CommerceSetPaymentByStripeIntentInput! + ): CommerceSetPaymentByStripeIntentPayload + + # Sets shipping information on an order based on the fulfillment type. + # Additionally, it recalculates and updates the order's total costs and tax values accordingly. + # If 'address_verified_by' is provided, a server side address verification will be performed accordingly. + commerceSetShipping( + # Parameters for SetShipping + input: CommerceSetShippingInput! + ): CommerceSetShippingPayload + + # Submits an order. If the order is from a private sale, it will also approve the order. + commerceSubmitOrder( + # Parameters for SubmitOrder + input: CommerceSubmitOrderInput! + ): CommerceSubmitOrderPayload + + # Submits an order with an offer. + commerceSubmitOrderWithOffer( + # Parameters for SubmitOrderWithOffer + input: CommerceSubmitOrderWithOfferInput! + ): CommerceSubmitOrderWithOfferPayload + + # Submits a pending offer. + commerceSubmitPendingOffer( + # Parameters for SubmitPendingOffer + input: CommerceSubmitPendingOfferInput! + ): CommerceSubmitPendingOfferPayload + + # Updates the value of impulse_conversation_id on an order + commerceUpdateImpulseConversationId( + # Parameters for UpdateImpulseConversationId + input: CommerceUpdateImpulseConversationIdInput! + ): CommerceUpdateImpulseConversationIdPayload confirmPassword(input: ConfirmPasswordInput!): ConfirmPasswordPayload # Create an account request @@ -10614,6 +12728,14 @@ type Mutation { input: CreateIdentityVerificationOverrideMutationInput! ): CreateIdentityVerificationOverrideMutationPayload createImage(input: CreateImageInput!): CreateImagePayload + createInquiryOfferOrder( + input: CommerceCreateInquiryOfferOrderWithArtworkInput! + ): CommerceCreateInquiryOfferOrderWithArtworkPayload + + # Creates an order and links the conversation to it + createInquiryOrder( + input: CommerceCreateInquiryOrderWithArtworkInput! + ): CommerceCreateInquiryOrderWithArtworkPayload # Creates an ordered set. createOrderedSet( @@ -10867,6 +12989,11 @@ type Mutation { submitInquiryRequestMutation( input: SubmitInquiryRequestMutationInput! ): SubmitInquiryRequestMutationPayload + + # Submits an OfferOrder and creates a conversation for it + submitOfferOrderWithConversation( + input: CommerceSubmitOrderWithOfferInput! + ): CommerceSubmitOrderWithOfferPayload transferMyCollection( input: TransferMyCollectionInput! ): TransferMyCollectionPayload @@ -13130,6 +15257,90 @@ type Query { term: String ): CollectorProfileTypeConnection + # Find balance of an account associated with a setup intent + commerceBankAccountBalance( + bankAccountId: ID + setupIntentId: ID + ): CommerceBankAccountBalance + + # Find list of competing orders + commerceCompetingOrders( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + orderId: ID! + ): CommerceOrderConnectionWithTotalCount + commerceLineItems( + # Returns the elements in the list that come after the specified cursor. + after: String + artworkId: String + + # Returns the elements in the list that come before the specified cursor. + before: String + editionSetId: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + orderStates: [CommerceOrderStateEnum!] + ): CommerceLineItemConnection + + # Return my orders + commerceMyOrders( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + mode: CommerceOrderModeEnum + sellerId: String + sort: CommerceOrderConnectionSortEnum + states: [CommerceOrderStateEnum!] + ): CommerceOrderConnectionWithTotalCount + + # Find an order by ID + commerceOrder(code: String, id: ID): CommerceOrder + + # Find list of orders + commerceOrders( + # Returns the elements in the list that come after the specified cursor. + after: String + + # Returns the elements in the list that come before the specified cursor. + before: String + buyerId: String + buyerType: String + + # Returns the first _n_ elements from the list. + first: Int + impulseConversationId: String + + # Returns the last _n_ elements from the list. + last: Int + mode: CommerceOrderModeEnum + sellerId: String + sellerType: String + sort: CommerceOrderConnectionSortEnum + state: CommerceOrderStateEnum + states: [CommerceOrderStateEnum!] + ): CommerceOrderConnectionWithTotalCount + # Sold or bought-in consignments consignments( # Returns the elements in the list that come after the specified cursor. diff --git a/src/config.ts b/src/config.ts index 729830d299..ba8bae56f9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,7 +25,6 @@ const { DIFFUSION_REQUEST_THROTTLE_MS, IPBASE_REQUEST_THROTTLE_MS, DIFFUSION_TOKEN, - DISABLE_EXCHANGE_SCHEMA_STITCHING, DISABLE_SCHEMA_STITCHING, EMBEDLY_ENDPOINT, EMBEDLY_KEY, @@ -156,7 +155,6 @@ export default { DIFFUSION_REQUEST_THROTTLE_MS: Number(DIFFUSION_REQUEST_THROTTLE_MS) || 600000, // 5 minutes IPBASE_REQUEST_THROTTLE_MS: Number(IPBASE_REQUEST_THROTTLE_MS) || 600000, // 5 minutes - DISABLE_EXCHANGE_SCHEMA_STITCHING, DISABLE_SCHEMA_STITCHING, EMBEDLY_ENDPOINT, EMBEDLY_KEY, diff --git a/src/index.ts b/src/index.ts index fba1654113..22c526737c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,9 +34,12 @@ import { principalFieldDirectiveExtension } from "directives/principleField/prin import { principalFieldDirectiveValidation } from "directives/principleField/principalFieldDirectiveValidation" import * as Sentry from "@sentry/node" import { bodyParserMiddleware } from "lib/bodyParserMiddleware" +import { + executableExchangeSchema, + legacyTransformsForExchange, +} from "lib/stitching/exchange/schema" const { - DISABLE_EXCHANGE_SCHEMA_STITCHING, ENABLE_GRAPHQL_UPLOAD, ENABLE_REQUEST_LOGGING, GRAPHQL_UPLOAD_MAX_FILE_SIZE_IN_BYTES, @@ -177,28 +180,21 @@ const graphqlServer = graphqlHTTP((req, res, params) => { xImpersonateUserID, }) + const exchangeSchema = executableExchangeSchema(legacyTransformsForExchange) + const context: ResolverContext = { accessToken, userID, defaultTimezone, ...loaders, // For stitching purposes + exchangeSchema, requestIDs, userAgent, appToken, ipAddress, xImpersonateUserID, } - if (!DISABLE_EXCHANGE_SCHEMA_STITCHING) { - const { - executableExchangeSchema, - legacyTransformsForExchange, - } = require("./lib/stitching/exchange/schema") - - context.exchangeSchema = executableExchangeSchema( - legacyTransformsForExchange - ) - } const validationRules = [ principalFieldDirectiveValidation, diff --git a/src/lib/stitching/exchange/schema.ts b/src/lib/stitching/exchange/schema.ts index c9a3937c5c..5c24c268b6 100644 --- a/src/lib/stitching/exchange/schema.ts +++ b/src/lib/stitching/exchange/schema.ts @@ -1,11 +1,13 @@ -import { createExchangeLink } from "./link" +import { readFileSync } from "fs" import { + RenameRootFields, + RenameTypes, + TransformInterfaceFields, + TransformObjectFields, makeRemoteExecutableSchema, transformSchema, - RenameTypes, - RenameRootFields, } from "graphql-tools" -import { readFileSync } from "fs" +import { createExchangeLink } from "./link" import { ReplaceCommerceDateTimeType } from "./transformers/replaceCommerceDateTimeType" export const executableExchangeSchema = (transforms) => { @@ -33,7 +35,8 @@ export const transformsForExchange = [ `commerce${name.charAt(0).toUpperCase() + name.slice(1)}` ), // replace CommerceDateTime field with MP's dateField - new ReplaceCommerceDateTimeType(), + new TransformInterfaceFields(ReplaceCommerceDateTimeType), + new TransformObjectFields(ReplaceCommerceDateTimeType), ] export const legacyTransformsForExchange = [ diff --git a/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts b/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts index be69de082a..63f57e179f 100644 --- a/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts +++ b/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts @@ -1,111 +1,31 @@ -import { Transform, VisitSchemaKind, visitSchema } from "graphql-tools" -import { - GraphQLSchema, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLFieldConfigMap, - GraphQLNonNull, - GraphQLString, - getNamedType, - isNamedType, - isWrappingType, -} from "graphql" -import { - createResolveType, - fieldToFieldConfig, -} from "graphql-tools/dist/stitching/schemaRecreation" +import { GraphQLNonNull, GraphQLString } from "graphql" +import { fieldToConfig } from "graphql-tools" import dateField from "schema/v2/fields/date" -type TypeWithSelectableFields = - | GraphQLObjectType - | GraphQLInterfaceType +export const ReplaceCommerceDateTimeType = ( + _typeName, + _fieldName, + fieldConfig +) => { + let newFieldConfig = fieldToConfig(fieldConfig) -export class ReplaceCommerceDateTimeType implements Transform { - public transformSchema(schema: GraphQLSchema): GraphQLSchema { - const newSchema = visitSchema(schema, { - [VisitSchemaKind.OBJECT_TYPE]: (type: GraphQLObjectType) => { - const fields = this.transformFields(type) - return ( - fields && - new GraphQLObjectType({ - fields, - name: type.name, - description: type.description, - astNode: type.astNode, - extensionASTNodes: type.extensionASTNodes, - isTypeOf: type.isTypeOf, - interfaces: type.getInterfaces(), - }) - ) - }, - - [VisitSchemaKind.INTERFACE_TYPE]: (type: GraphQLInterfaceType) => { - const fields = this.transformFields(type) - return ( - fields && - new GraphQLInterfaceType({ - fields, - name: type.name, - description: type.description, - astNode: type.astNode, - resolveType: type.resolveType, - extensionASTNodes: type.extensionASTNodes, - }) - ) - }, - }) - - return newSchema + if (fieldConfig.type.toString() === "CommerceDateTime!") { + newFieldConfig = { + ...newFieldConfig, + ...dateField, + type: new GraphQLNonNull(GraphQLString), + } + return newFieldConfig } - private transformFields(type: TypeWithSelectableFields) { - let madeChanges = false - const fields = type.getFields() - const newFields: GraphQLFieldConfigMap = {} - const resolveType = createResolveType((_name, type) => { - if ( - isNamedType(type) && - (type.name === "CommerceDateTime" || - (isWrappingType(type) && - type.ofType && - type.ofType.name === "CommerceDateTime")) - ) { - return dateField.type - } - return type - }) + if (fieldConfig.type.toString() === "CommerceDateTime") { + newFieldConfig = { + ...newFieldConfig, + ...dateField, + } - Object.entries(fields).forEach(([fieldName, fieldDefinition]) => { - const fieldConfig = fieldToFieldConfig(fieldDefinition, resolveType, true) - const type = fieldDefinition.type - // If it's not a type we want to replace, just skip it - if ( - isNamedType(type) && - ["CommerceDateTime", "CommerceDate"].includes(type.name) - ) { - madeChanges = true - newFields[fieldName] = { - ...fieldConfig, - ...dateField, - } - } else if ( - ["CommerceDateTime!", "CommerceDate!"].includes( - // FIXME: Something is really wrong here, you can't pass a field def - // to getNamedType. - (getNamedType(fieldDefinition as any)! as any).type.toString() - ) - ) { - madeChanges = true - newFields[fieldName] = { - ...fieldConfig, - ...dateField, - type: new GraphQLNonNull(GraphQLString), - } - } else { - newFields[fieldName] = fieldConfig - } - }) - - return madeChanges ? newFields : undefined + return newFieldConfig } + + return undefined } diff --git a/src/lib/stitching/mergeSchemas.ts b/src/lib/stitching/mergeSchemas.ts index 28fd61d7f4..8f11f7cd8d 100644 --- a/src/lib/stitching/mergeSchemas.ts +++ b/src/lib/stitching/mergeSchemas.ts @@ -11,9 +11,10 @@ import { gravityStitchingEnvironment as gravityStitchingEnvironmentV2 } from "./ import { exchangeStitchingEnvironment as exchangeStitchingEnvironmentV2 } from "./exchange/v2/stitching" import { consignmentStitchingEnvironment as convectionStitchingEnvironmentV2 } from "./convection/v2/stitching" import { causalityStitchingEnvironment as causalityStitchingEnvironmentV2 } from "./causality/v2/stitching" -import config from "config" - -const { DISABLE_EXCHANGE_SCHEMA_STITCHING } = config +import { + executableExchangeSchema, + transformsForExchange, +} from "./exchange/schema" /** * Incrementally merges in schemas according to `process.env` @@ -55,19 +56,12 @@ export const incrementalMergeSchemas = (localSchema) => { const diffusionSchema = executableDiffusionSchema() schemas.push(diffusionSchema) - if (!DISABLE_EXCHANGE_SCHEMA_STITCHING) { - const { - executableExchangeSchema, - transformsForExchange, - } = require("./lib/stitching/exchange/schema") - - const exchangeSchema = executableExchangeSchema(transformsForExchange) - schemas.push(exchangeSchema) + const exchangeSchema = executableExchangeSchema(transformsForExchange) + schemas.push(exchangeSchema) - useStitchingEnvironment( - exchangeStitchingEnvironmentV2({ localSchema, exchangeSchema }) - ) - } + useStitchingEnvironment( + exchangeStitchingEnvironmentV2({ localSchema, exchangeSchema }) + ) const convectionSchema = executableConvectionSchema() schemas.push(convectionSchema) From 4f3e691727b66b8fb02a375c3ff0004a2decfb31 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 15:05:57 +0100 Subject: [PATCH 17/26] =?UTF-8?q?fix:=20typescript=20issues=20=F0=9F=91=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - patches/@types/graphql-relay+0.4.9.patch | 76 ----------------- patches/graphql-relay+0.7.0.patch | 82 +++++++++++++++++++ .../causality/__tests__/testingUtils.ts | 13 ++- src/lib/stitching/causality/schema.ts | 7 +- src/lib/stitching/causality/v2/stitching.ts | 8 +- .../convection/__tests__/testingUtils.ts | 13 ++- src/lib/stitching/convection/v2/stitching.ts | 3 +- src/lib/stitching/diffusion/v2/stitching.ts | 3 +- .../__tests__/replaceComerceDateTime.test.ts | 9 +- .../exchange/__tests__/testingUtils.ts | 13 ++- src/lib/stitching/exchange/v2/stitching.ts | 9 +- .../gravity/__tests__/testingUtils.ts | 14 ++-- src/lib/stitching/gravity/v2/stitching.ts | 3 +- src/lib/stitching/logLinkMiddleware.ts | 3 + src/lib/stitching/vortex/schema.ts | 9 +- src/schema/v2/artwork/index.ts | 8 +- src/schema/v2/fields/pagination.ts | 6 +- src/schema/v2/users/deleteUserMutation.ts | 2 +- yarn.lock | 2 +- 20 files changed, 158 insertions(+), 126 deletions(-) delete mode 100644 patches/@types/graphql-relay+0.4.9.patch diff --git a/package.json b/package.json index 51a3b2e2a1..a50ace451c 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,6 @@ "@graphql-inspector/core": "1.27.0", "@types/express-rate-limit": "2.9.3", "@types/google-libphonenumber": "^7.4.22", - "@types/graphql-relay": "0.4.9", "@types/graphql-upload": "^8.0.11", "@types/invariant": "2.2.29", "@types/jest": "23.3.2", diff --git a/patches/@types/graphql-relay+0.4.9.patch b/patches/@types/graphql-relay+0.4.9.patch deleted file mode 100644 index c26ef7055e..0000000000 --- a/patches/@types/graphql-relay+0.4.9.patch +++ /dev/null @@ -1,76 +0,0 @@ -patch-package ---- a/node_modules/@types/graphql-relay/index.d.ts -+++ b/node_modules/@types/graphql-relay/index.d.ts -@@ -70,8 +70,11 @@ export interface ConnectionConfig { - nodeType: ConnectionConfigNodeType; - resolveNode?: GraphQLFieldResolver | null; - resolveCursor?: GraphQLFieldResolver | null; -+ edgeType?: GraphQLObjectType | null; - edgeFields?: Thunk> | null; -+ edgeInterfaces?: GraphQLInterfaceType[]; - connectionFields?: Thunk> | null; -+ connectionInterfaces?: GraphQLInterfaceType[]; - } - - export interface GraphQLConnectionDefinitions { -@@ -104,6 +107,8 @@ export interface PageInfo { - hasNextPage?: boolean | null; - } - -+export const PageInfoType: GraphQLObjectType -+ - /** - * A flow type designed to be exposed as a `Connection` over GraphQL. - */ -@@ -135,6 +140,8 @@ export interface ConnectionArguments { - export interface ArraySliceMetaInfo { - sliceStart: number; - arrayLength: number; -+ useValueAsEdge?: boolean; -+ resolveNode?: GraphQLFieldResolver | null; - } - - /** -@@ -211,11 +218,11 @@ export function getOffsetWithDefault( - - // mutation/mutation.js - --export type mutationFn = ( -- object: any, -- ctx: any, -+export type mutationFn = ( -+ object: TInput, -+ ctx: TContext, - info: GraphQLResolveInfo --) => Promise | any; -+) => Promise | TOutput; - - /** - * A description of a mutation consumable by mutationWithClientMutationId -@@ -231,12 +238,12 @@ export type mutationFn = ( - * input field, and it should return an Object with a key for each - * output field. It may return synchronously, or return a Promise. - */ --export interface MutationConfig { -+export interface MutationConfig { - name: string; - description?: string; - inputFields: Thunk; -- outputFields: Thunk>; -- mutateAndGetPayload: mutationFn; -+ outputFields: Thunk>; -+ mutateAndGetPayload: mutationFn; - deprecationReason?: string; - } - -@@ -244,8 +251,8 @@ export interface MutationConfig { - * Returns a GraphQLFieldConfig for the mutation described by the - * provided MutationConfig. - */ --export function mutationWithClientMutationId( -- config: MutationConfig -+export function mutationWithClientMutationId( -+ config: MutationConfig - ): GraphQLFieldConfig; - - // node/node.js diff --git a/patches/graphql-relay+0.7.0.patch b/patches/graphql-relay+0.7.0.patch index 35bc9fb3d0..dbab23f914 100644 --- a/patches/graphql-relay+0.7.0.patch +++ b/patches/graphql-relay+0.7.0.patch @@ -1,3 +1,16 @@ +diff --git a/node_modules/graphql-relay/connection/arrayConnection.d.ts b/node_modules/graphql-relay/connection/arrayConnection.d.ts +index 5abd394..6b06c92 100644 +--- a/node_modules/graphql-relay/connection/arrayConnection.d.ts ++++ b/node_modules/graphql-relay/connection/arrayConnection.d.ts +@@ -8,6 +8,8 @@ import type { + export interface ArraySliceMetaInfo { + sliceStart: number; + arrayLength: number; ++ useValueAsEdge?: boolean; ++ resolveNode?: GraphQLFieldResolver | null; + } + + /** diff --git a/node_modules/graphql-relay/connection/arrayConnection.js b/node_modules/graphql-relay/connection/arrayConnection.js index 5a42ae5..bec0ba9 100644 --- a/node_modules/graphql-relay/connection/arrayConnection.js @@ -29,6 +42,29 @@ index 5a42ae5..bec0ba9 100644 const firstEdge = edges[0]; const lastEdge = edges[edges.length - 1]; const lowerBound = after != null ? afterOffset + 1 : 0; +diff --git a/node_modules/graphql-relay/connection/connection.d.ts b/node_modules/graphql-relay/connection/connection.d.ts +index b6a0e45..0b89ee6 100644 +--- a/node_modules/graphql-relay/connection/connection.d.ts ++++ b/node_modules/graphql-relay/connection/connection.d.ts +@@ -64,7 +64,9 @@ export interface ConnectionConfig { + resolveNode?: GraphQLFieldResolver; + resolveCursor?: GraphQLFieldResolver; + edgeFields?: Thunk>; ++ edgeInterfaces?: GraphQLInterfaceType[]; + connectionFields?: Thunk>; ++ connectionInterfaces?: GraphQLInterfaceType[]; + } + + export interface GraphQLConnectionDefinitions { +@@ -72,6 +74,8 @@ export interface GraphQLConnectionDefinitions { + connectionType: GraphQLObjectType; + } + ++export const PageInfoType: GraphQLObjectType ++ + /** + * Returns a GraphQLObjectType for a connection with the given name, + * and whose nodes are of the specified type. diff --git a/node_modules/graphql-relay/connection/connection.js b/node_modules/graphql-relay/connection/connection.js index 23c916f..081f3b3 100644 --- a/node_modules/graphql-relay/connection/connection.js @@ -88,3 +124,49 @@ index 670c089..77a49e6 100644 Object.defineProperty(exports, "connectionFromArray", { enumerable: true, get: function () { +diff --git a/node_modules/graphql-relay/mutation/mutation.d.ts b/node_modules/graphql-relay/mutation/mutation.d.ts +index c4915e0..294213e 100644 +--- a/node_modules/graphql-relay/mutation/mutation.d.ts ++++ b/node_modules/graphql-relay/mutation/mutation.d.ts +@@ -8,11 +8,11 @@ import type { + } from 'graphql'; + + // TS_SPECIFIC: This type is only exported by TypeScript +-export type MutationFn = ( +- object: any, +- ctx: any, ++export type mutationFn = ( ++ object: TInput, ++ ctx: TContext, + info: GraphQLResolveInfo, +-) => Promise | any; ++) => Promise | TOutput; + + // TS_SPECIFIC: This type is only exported by TypeScript + /** +@@ -29,20 +29,20 @@ export type MutationFn = ( + * input field, and it should return an Object with a key for each + * output field. It may return synchronously, or return a Promise. + */ +-export interface MutationConfig { ++export interface MutationConfig { + name: string; + description?: string; + deprecationReason?: string; + extensions?: GraphQLFieldExtensions; + inputFields: Thunk; +- outputFields: Thunk>; +- mutateAndGetPayload: MutationFn; ++ outputFields: Thunk>; ++ mutateAndGetPayload: mutationFn; + } + + /** + * Returns a GraphQLFieldConfig for the mutation described by the + * provided MutationConfig. + */ +-export function mutationWithClientMutationId( +- config: MutationConfig, ++export function mutationWithClientMutationId( ++ config: MutationConfig + ): GraphQLFieldConfig; diff --git a/src/lib/stitching/causality/__tests__/testingUtils.ts b/src/lib/stitching/causality/__tests__/testingUtils.ts index d14cc47756..710f740277 100644 --- a/src/lib/stitching/causality/__tests__/testingUtils.ts +++ b/src/lib/stitching/causality/__tests__/testingUtils.ts @@ -1,14 +1,13 @@ import { executableCausalitySchema } from "../schema" import { - getTypesFromSchema, - getRootFieldsFromSchema, getFieldsForTypeFromSchema, + getRootFieldsFromSchema, + getTypesFromSchema, } from "lib/stitching/lib/getTypesFromSchema" import { causalityStitchingEnvironment as causalityStitchingEnvironmentV2 } from "../v2/stitching" -import { mergeSchemas } from "graphql-tools" -import { GraphQLSchema } from "graphql" +import { GraphQLSchemaWithTransforms, mergeSchemas } from "graphql-tools" import localSchema from "schema/v2/schema" /** @@ -36,9 +35,9 @@ export async function useCausalityStitching() { * stitching environment and then caching the results. */ -let cachedSchema: GraphQLSchema & { transforms: any } +let cachedSchema: GraphQLSchemaWithTransforms let stitchedSchema: ReturnType -let mergedSchema: GraphQLSchema & { transforms: any } +let mergedSchema: GraphQLSchemaWithTransforms /** * Gets a cached copy of the transformed causality schema @@ -78,7 +77,7 @@ const getCausalityMergedSchema = async () => { mergedSchema = mergeSchemas({ schemas: [localSchema, cachedSchema, extensionSchema], resolvers: resolvers, - }) as GraphQLSchema & { transforms: any } + }) as GraphQLSchemaWithTransforms const anyMergedSchema = mergedSchema as any anyMergedSchema.__allowedLegacyNames = ["__id"] diff --git a/src/lib/stitching/causality/schema.ts b/src/lib/stitching/causality/schema.ts index 3efa20f2eb..c2cd22290f 100644 --- a/src/lib/stitching/causality/schema.ts +++ b/src/lib/stitching/causality/schema.ts @@ -30,8 +30,11 @@ export const executableCausalitySchema = () => { // Return the new modified schema return transformSchema(schema, [ new FilterTypes((type) => !allowlistedTypes.includes(type.name)), - new FilterRootFields((_operation, name, _field) => { - return permittedRootFields.includes(name) + new FilterRootFields((_operation, name) => { + if (name) { + return permittedRootFields.includes(name) + } + return false }), new RenameTypes((name) => { if (name === "Long") return "Long" diff --git a/src/lib/stitching/causality/v2/stitching.ts b/src/lib/stitching/causality/v2/stitching.ts index 88ffdfaf17..4712571808 100644 --- a/src/lib/stitching/causality/v2/stitching.ts +++ b/src/lib/stitching/causality/v2/stitching.ts @@ -1,12 +1,13 @@ import gql from "lib/gql" import { GraphQLSchema } from "graphql" import { resolveLotCentsFieldToMoney } from "schema/v2/fields/money" +import { GraphQLSchemaWithTransforms } from "graphql-tools" export const causalityStitchingEnvironment = ({ causalitySchema, localSchema, }: { - causalitySchema: GraphQLSchema & { transforms: any } + causalitySchema: GraphQLSchemaWithTransforms localSchema: GraphQLSchema }) => { return { @@ -166,7 +167,10 @@ export const causalityStitchingEnvironment = ({ }, [] ) - return { ...lotStandingsConnection, edges: availableEdges } + return { + ...lotStandingsConnection, + edges: availableEdges, + } }) }, }, diff --git a/src/lib/stitching/convection/__tests__/testingUtils.ts b/src/lib/stitching/convection/__tests__/testingUtils.ts index 72945b9b56..5f95a11944 100644 --- a/src/lib/stitching/convection/__tests__/testingUtils.ts +++ b/src/lib/stitching/convection/__tests__/testingUtils.ts @@ -1,14 +1,13 @@ import { executableConvectionSchema } from "../schema" import { - getTypesFromSchema, - getRootFieldsFromSchema, getFieldsForTypeFromSchema, + getRootFieldsFromSchema, + getTypesFromSchema, } from "lib/stitching/lib/getTypesFromSchema" import { consignmentStitchingEnvironment } from "../v2/stitching" -import { mergeSchemas } from "graphql-tools" -import { GraphQLSchema } from "graphql" +import { GraphQLSchemaWithTransforms, mergeSchemas } from "graphql-tools" import localSchema from "schema/v2/schema" /** @@ -36,9 +35,9 @@ export async function useConvectionStitching() { * stitching environment and then caching the results. */ -let cachedSchema: GraphQLSchema & { transforms: any } +let cachedSchema: GraphQLSchemaWithTransforms let stitchedSchema: ReturnType -let mergedSchema: GraphQLSchema & { transforms: any } +let mergedSchema: GraphQLSchemaWithTransforms /** * Gets a cached copy of the transformed convection schema @@ -75,7 +74,7 @@ const getConvectionMergedSchema = async () => { mergedSchema = mergeSchemas({ schemas: [localSchema, cachedSchema, extensionSchema], resolvers: resolvers, - }) as GraphQLSchema & { transforms: any } + }) as GraphQLSchemaWithTransforms const anyMergedSchema = mergedSchema as any anyMergedSchema.__allowedLegacyNames = ["__id"] diff --git a/src/lib/stitching/convection/v2/stitching.ts b/src/lib/stitching/convection/v2/stitching.ts index 024d648456..35485a2427 100644 --- a/src/lib/stitching/convection/v2/stitching.ts +++ b/src/lib/stitching/convection/v2/stitching.ts @@ -1,10 +1,11 @@ import { GraphQLSchema } from "graphql" import { amount, amountSDL } from "schema/v2/fields/money" import gql from "lib/gql" +import { GraphQLSchemaWithTransforms } from "graphql-tools" export const consignmentStitchingEnvironment = ( localSchema: GraphQLSchema, - convectionSchema: GraphQLSchema & { transforms: any } + convectionSchema: GraphQLSchemaWithTransforms ) => ({ // The SDL used to declare how to stitch an object extensionSchema: ` diff --git a/src/lib/stitching/diffusion/v2/stitching.ts b/src/lib/stitching/diffusion/v2/stitching.ts index 6e5552ad61..3ee9513ee9 100644 --- a/src/lib/stitching/diffusion/v2/stitching.ts +++ b/src/lib/stitching/diffusion/v2/stitching.ts @@ -1,8 +1,9 @@ import { GraphQLSchema } from "graphql" +import { GraphQLSchemaWithTransforms } from "graphql-tools" export const diffusionStitchingEnvironment = ( _localSchema: GraphQLSchema, - _diffusionSchema: GraphQLSchema & { transforms: any } + _diffusionSchema: GraphQLSchemaWithTransforms ) => ({ // The SDL used to declare how to stitch an object extensionSchema: "", diff --git a/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts b/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts index 119ddb17bc..743e969f2c 100644 --- a/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts +++ b/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts @@ -1,7 +1,11 @@ import { GraphQLSchema, GraphQLObjectType, GraphQLScalarType } from "graphql" import { runQueryOrThrow } from "schema/v2/test/utils" import gql from "lib/gql" -import { transformSchema } from "graphql-tools" +import { + TransformInterfaceFields, + TransformObjectFields, + transformSchema, +} from "graphql-tools" import { ReplaceCommerceDateTimeType } from "../transformers/replaceCommerceDateTimeType" const originalSchema = new GraphQLSchema({ @@ -26,7 +30,8 @@ const originalSchema = new GraphQLSchema({ }) const schema = transformSchema(originalSchema, [ - new ReplaceCommerceDateTimeType(), + new TransformInterfaceFields(ReplaceCommerceDateTimeType), + new TransformObjectFields(ReplaceCommerceDateTimeType), ]) describe("ReplaceCommerceDateTimeType", () => { diff --git a/src/lib/stitching/exchange/__tests__/testingUtils.ts b/src/lib/stitching/exchange/__tests__/testingUtils.ts index 4e0957701b..5fb8077e39 100644 --- a/src/lib/stitching/exchange/__tests__/testingUtils.ts +++ b/src/lib/stitching/exchange/__tests__/testingUtils.ts @@ -1,12 +1,11 @@ -import { mergeSchemas } from "graphql-tools" -import { exchangeStitchingEnvironment } from "../v2/stitching" -import { GraphQLSchema } from "graphql" -import { executableExchangeSchema, transformsForExchange } from "../schema" +import { GraphQLSchemaWithTransforms, mergeSchemas } from "graphql-tools" import localSchema from "schema/v2/schema" +import { executableExchangeSchema, transformsForExchange } from "../schema" +import { exchangeStitchingEnvironment } from "../v2/stitching" -let cachedSchema: GraphQLSchema & { transforms: any } +let cachedSchema: GraphQLSchemaWithTransforms let stitchedSchema: ReturnType -let mergedSchema: GraphQLSchema & { transforms: any } +let mergedSchema: GraphQLSchemaWithTransforms /** Gets a cached copy of the transformed exchange schema */ export const getExchangeTransformedSchema = async () => { @@ -39,7 +38,7 @@ export const getExchangeMergedSchema = async () => { mergedSchema = mergeSchemas({ schemas: [localSchema, cachedSchema, extensionSchema], resolvers: resolvers, - }) as GraphQLSchema & { transforms: any } + }) as GraphQLSchemaWithTransforms const anyMergedSchema = mergedSchema as any anyMergedSchema.__allowedLegacyNames = ["__id"] diff --git a/src/lib/stitching/exchange/v2/stitching.ts b/src/lib/stitching/exchange/v2/stitching.ts index 167a284310..c032dd3449 100644 --- a/src/lib/stitching/exchange/v2/stitching.ts +++ b/src/lib/stitching/exchange/v2/stitching.ts @@ -4,7 +4,7 @@ import gql from "lib/gql" import { toGlobalId } from "graphql-relay" import { delegateToSchema } from "@graphql-tools/delegate" import { ArtworkVersionType } from "schema/v2/artwork_version" -import { WrapQuery } from "graphql-tools" +import { GraphQLSchemaWithTransforms, WrapQuery } from "graphql-tools" const orderTotals = [ "itemsTotal", @@ -33,7 +33,7 @@ export const exchangeStitchingEnvironment = ({ exchangeSchema, }: { localSchema: GraphQLSchema - exchangeSchema: GraphQLSchema & { transforms: any } + exchangeSchema: GraphQLSchemaWithTransforms }) => { type DetailsFactoryInput = { from: string; to: string } @@ -832,7 +832,10 @@ export const exchangeStitchingEnvironment = ({ }, }, ] - return { ...selectionSet, selections: newSelections } + return { + ...selectionSet, + selections: newSelections, + } }, (result) => { return result diff --git a/src/lib/stitching/gravity/__tests__/testingUtils.ts b/src/lib/stitching/gravity/__tests__/testingUtils.ts index 1e94f90715..16c8770b88 100644 --- a/src/lib/stitching/gravity/__tests__/testingUtils.ts +++ b/src/lib/stitching/gravity/__tests__/testingUtils.ts @@ -1,18 +1,18 @@ -import { mergeSchemas } from "graphql-tools" -import { gravityStitchingEnvironment as gravityStitchingEnvironmentV2 } from "../v2/stitching" -import { GraphQLSchema } from "graphql" -import { executableGravitySchema } from "../schema" +import { GraphQLSchemaWithTransforms, mergeSchemas } from "graphql-tools" import localSchema from "schema/v2/schema" +import { executableGravitySchema } from "../schema" +import { gravityStitchingEnvironment as gravityStitchingEnvironmentV2 } from "../v2/stitching" -let cachedSchema: GraphQLSchema & { transforms: any } +let cachedSchema: GraphQLSchemaWithTransforms /** Gets a cached copy of the transformed gravity schema */ -export const getGravityTransformedSchema = async () => { +const getGravityTransformedSchema = async () => { if (!cachedSchema) { cachedSchema = await executableGravitySchema() } return cachedSchema } +export default getGravityTransformedSchema /** Gets a cached copy of the stitched schema, independent of being merged into the local schema */ export const getGravityStitchedSchema = async () => { @@ -30,7 +30,7 @@ export const getGravityMergedSchema = async () => { const mergedSchema = mergeSchemas({ schemas: [localSchema, cachedSchema, extensionSchema], resolvers: resolvers, - }) as GraphQLSchema & { transforms: any } + }) const anyMergedSchema = mergedSchema as any anyMergedSchema.__allowedLegacyNames = ["__id"] diff --git a/src/lib/stitching/gravity/v2/stitching.ts b/src/lib/stitching/gravity/v2/stitching.ts index 5138d7e0f9..44ae41c5b7 100644 --- a/src/lib/stitching/gravity/v2/stitching.ts +++ b/src/lib/stitching/gravity/v2/stitching.ts @@ -12,6 +12,7 @@ import { dateRange } from "lib/date" import { resolveSearchCriteriaLabels } from "schema/v2/previewSavedSearch/searchCriteriaLabel" import { generateDisplayName } from "schema/v2/previewSavedSearch/generateDisplayName" import { amount, amountSDL } from "schema/v2/fields/money" +import { GraphQLSchemaWithTransforms } from "graphql-tools" const LocaleEnViewingRoomRelativeShort = "en-viewing-room-relative-short" defineCustomLocale(LocaleEnViewingRoomRelativeShort, { @@ -62,7 +63,7 @@ function argsToSDL(args: GraphQLFieldConfigArgumentMap) { export const gravityStitchingEnvironment = ( localSchema: GraphQLSchema, - gravitySchema: GraphQLSchema & { transforms: any } + gravitySchema: GraphQLSchemaWithTransforms ) => { return { // The SDL used to declare how to stitch an object diff --git a/src/lib/stitching/logLinkMiddleware.ts b/src/lib/stitching/logLinkMiddleware.ts index 9798d27a31..3028655964 100644 --- a/src/lib/stitching/logLinkMiddleware.ts +++ b/src/lib/stitching/logLinkMiddleware.ts @@ -17,6 +17,9 @@ const enableRequestLogging = ENABLE_REQUEST_LOGGING === "true" */ export const responseLoggerLink = (name: string) => { return new ApolloLink((operation, forward) => { + // TODO: Check this with Chris + // Forward is not required here + // @ts-ignore if (!(forward && operation)) { return null } diff --git a/src/lib/stitching/vortex/schema.ts b/src/lib/stitching/vortex/schema.ts index a3e11742b8..d751dc057a 100644 --- a/src/lib/stitching/vortex/schema.ts +++ b/src/lib/stitching/vortex/schema.ts @@ -37,9 +37,12 @@ export const executableVortexSchema = ({ // accessible through artwork ...(removeRootFields ? [ - new FilterRootFields( - (_operation, name) => !removeRootFieldList.includes(name) - ), + new FilterRootFields((_operation, name) => { + if (name) { + return !removeRootFieldList.includes(name) + } + return true + }), ] : []), new RenameTypes((name) => { diff --git a/src/schema/v2/artwork/index.ts b/src/schema/v2/artwork/index.ts index cfa6f571c9..b94cd2a09a 100644 --- a/src/schema/v2/artwork/index.ts +++ b/src/schema/v2/artwork/index.ts @@ -12,7 +12,6 @@ import { GraphQLString, GraphQLUnionType, } from "graphql" -import { PageInfoType } from "graphql-relay" // Mapping of category ids to MediumType values import artworkMediums from "lib/artworkMediums" // Mapping of attribution_class ids to AttributionClass values @@ -92,6 +91,7 @@ import { import { pageable } from "relay-cursor-paging" import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { error } from "lib/loggers" +import { PageInfoType } from "graphql-relay" const has_price_range = (price) => { return new RegExp(/-/).test(price) @@ -1866,7 +1866,11 @@ export const ArtworkConnectionInterface = new GraphQLInterfaceType({ name: "ArtworkConnectionInterface", fields: { pageCursors: { type: new GraphQLNonNull(PageCursorsType) }, - pageInfo: { type: new GraphQLNonNull(PageInfoType) }, + pageInfo: { + // TODO: not sure how to fix this - will ask for help + // @ts-ignore + type: new GraphQLNonNull(PageInfoType), + }, edges: { type: new GraphQLList(ArtworkEdgeInterface) }, }, }) diff --git a/src/schema/v2/fields/pagination.ts b/src/schema/v2/fields/pagination.ts index 65a9da648c..93ff3078bd 100644 --- a/src/schema/v2/fields/pagination.ts +++ b/src/schema/v2/fields/pagination.ts @@ -10,12 +10,14 @@ import { import { connectionDefinitions, toGlobalId, - ConnectionConfig, - GraphQLConnectionDefinitions, connectionFromArraySlice, ConnectionArguments, connectionFromArray, } from "graphql-relay" +import { + ConnectionConfig, + GraphQLConnectionDefinitions, +} from "graphql-relay/connection/connection" import { warn } from "lib/loggers" import { pick } from "lodash" import { ResolverContext } from "types/graphql" diff --git a/src/schema/v2/users/deleteUserMutation.ts b/src/schema/v2/users/deleteUserMutation.ts index b0fc85364d..a8790d63a6 100644 --- a/src/schema/v2/users/deleteUserMutation.ts +++ b/src/schema/v2/users/deleteUserMutation.ts @@ -4,13 +4,13 @@ import { GraphQLString, GraphQLUnionType, } from "graphql" -import { mutationWithClientMutationId } from "graphql-relay" import { formatGravityError, GravityMutationErrorType, } from "lib/gravityErrorHandler" import { ResolverContext } from "types/graphql" import { UserType } from "../user" +import { mutationWithClientMutationId } from "graphql-relay" interface DeleteUserMutationInputProps { id: string diff --git a/yarn.lock b/yarn.lock index b616f3b7ec..e1b3853e18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2106,7 +2106,7 @@ resolved "https://registry.yarnpkg.com/@types/google-libphonenumber/-/google-libphonenumber-7.4.22.tgz#97320192e6482eb4413b935f221d229da346d5db" integrity sha512-Hax2fIzdnSH9zWHyUM6/z2scyE2NigZZQKyzst1IuAc/aW66iozy1y2mBvxJgRr3dBD5RikcRKNN8pQHhwiAjQ== -"@types/graphql-relay@0.4.9", "@types/graphql-relay@^0.4.0": +"@types/graphql-relay@^0.4.0": version "0.4.9" resolved "https://registry.yarnpkg.com/@types/graphql-relay/-/graphql-relay-0.4.9.tgz#0f34ee87a1bf1fc4c986eeefe0707318c7433212" integrity sha512-SL0UXsnNozTBIXwSs0pGB1iTWKaQzxmfqBwx9m0NvDGg463sYaFw4f7rizTzL4OSaVobLkvGJWUPesbg66MfHw== From cf905e864590052e52d7831ef7db862c232b2be7 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 17 Nov 2023 15:17:35 +0100 Subject: [PATCH 18/26] fix: graphql-tools weird error --- .../{graphql-tools+4.0.7.patch => graphql-tools+4.0.8.patch} | 0 src/schema/v2/artwork/index.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename patches/{graphql-tools+4.0.7.patch => graphql-tools+4.0.8.patch} (100%) diff --git a/patches/graphql-tools+4.0.7.patch b/patches/graphql-tools+4.0.8.patch similarity index 100% rename from patches/graphql-tools+4.0.7.patch rename to patches/graphql-tools+4.0.8.patch diff --git a/src/schema/v2/artwork/index.ts b/src/schema/v2/artwork/index.ts index b94cd2a09a..649633a141 100644 --- a/src/schema/v2/artwork/index.ts +++ b/src/schema/v2/artwork/index.ts @@ -91,6 +91,7 @@ import { import { pageable } from "relay-cursor-paging" import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { error } from "lib/loggers" +// @ts-ignore import { PageInfoType } from "graphql-relay" const has_price_range = (price) => { @@ -1868,7 +1869,6 @@ export const ArtworkConnectionInterface = new GraphQLInterfaceType({ pageCursors: { type: new GraphQLNonNull(PageCursorsType) }, pageInfo: { // TODO: not sure how to fix this - will ask for help - // @ts-ignore type: new GraphQLNonNull(PageInfoType), }, edges: { type: new GraphQLList(ArtworkEdgeInterface) }, From 3f22535395f6388f5273561322271c30e9877557 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 14:03:23 +0100 Subject: [PATCH 19/26] fix: ts issue --- _schemaV2.graphql | 2750 +++++++++++++++----------------- src/schema/v2/sale_artworks.ts | 11 +- 2 files changed, 1312 insertions(+), 1449 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 13f12ac030..381852a16f 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -2,6 +2,17 @@ directive @optionalField on FIELD directive @principalField on FIELD +type ARImage { + height: Int + imageURLs: ImageURLs + internalID: ID! + width: Int +} + +input ARImageInput { + internalID: ID! +} + # Autogenerated input type of AcceptPartnerAgreement input AcceptPartnerAgreementInput { # A unique identifier for the client performing the mutation. @@ -35,100 +46,50 @@ type AccountRequest { notes: String } -# Autogenerated input type of AddAssetsToConsignmentSubmission -input AddAssetsToConsignmentSubmissionInput { +# Autogenerated input type of AddAssetToConsignmentSubmission +input AddAssetToConsignmentSubmissionInput { assetType: String # A unique identifier for the client performing the mutation. clientMutationId: String externalSubmissionId: ID filename: String - geminiTokens: [String!]! + geminiToken: String! sessionID: String size: String submissionID: ID } -# Autogenerated return type of AddAssetsToConsignmentSubmission -type AddAssetsToConsignmentSubmissionPayload { - assets: [ConsignmentSubmissionCategoryAsset!] +# Autogenerated return type of AddAssetToConsignmentSubmission +type AddAssetToConsignmentSubmissionPayload { + asset: ConsignmentSubmissionCategoryAsset # A unique identifier for the client performing the mutation. clientMutationId: String } -# Autogenerated input type of AddAssetToConsignmentSubmission -input AddAssetToConsignmentSubmissionInput { +# Autogenerated input type of AddAssetsToConsignmentSubmission +input AddAssetsToConsignmentSubmissionInput { assetType: String # A unique identifier for the client performing the mutation. clientMutationId: String externalSubmissionId: ID filename: String - geminiToken: String! + geminiTokens: [String!]! sessionID: String size: String submissionID: ID } -# Autogenerated return type of AddAssetToConsignmentSubmission -type AddAssetToConsignmentSubmissionPayload { - asset: ConsignmentSubmissionCategoryAsset +# Autogenerated return type of AddAssetsToConsignmentSubmission +type AddAssetsToConsignmentSubmissionPayload { + assets: [ConsignmentSubmissionCategoryAsset!] # A unique identifier for the client performing the mutation. clientMutationId: String } -type addOrderedSetItemFailure { - mutationError: GravityMutationError -} - -input addOrderedSetItemMutationInput { - clientMutationId: String - geminiToken: String - id: String! - itemId: String! - position: Int -} - -type addOrderedSetItemMutationPayload { - # On success: the updated parent set or the set item added. - addOrderedSetItemResponseOrError: addOrderedSetItemResponseOrError - clientMutationId: String -} - -union addOrderedSetItemResponseOrError = - addOrderedSetItemFailure - | addOrderedSetItemSuccess - -type addOrderedSetItemSuccess { - set: OrderedSet - setItem: OrderedSetItem -} - -type addUserRoleFailure { - mutationError: GravityMutationError -} - -input addUserRoleMutationInput { - clientMutationId: String - id: String! - role_type: String! -} - -type addUserRoleMutationPayload { - clientMutationId: String - - # On success: the user - userOrError: addUserRoleResponseOrError -} - -union addUserRoleResponseOrError = addUserRoleFailure | addUserRoleSuccess - -type addUserRoleSuccess { - user: User -} - # Autogenerated input type of AddUserToSubmissionMutation input AddUserToSubmissionMutationInput { # A unique identifier for the client performing the mutation. @@ -147,7 +108,7 @@ type Admin { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -167,7 +128,7 @@ type AdminCreateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -182,7 +143,7 @@ type AdminDeleteFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] success: Boolean } @@ -205,7 +166,7 @@ type AdminToggleFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] success: Boolean } @@ -224,7 +185,7 @@ type AdminUpdateFeatureFlagPayload { # A list of feature flags featureFlags( # The sort order of the results - sortBy: FeatureFlagsSortBy + sortBy: FeatureFlagsSortBy = NAME ): [FeatureFlag] } @@ -1112,17 +1073,6 @@ input AppSecondFactorAttributes { # An app second factor or errors union AppSecondFactorOrErrorsUnion = AppSecondFactor | Errors -type ARImage { - height: Int - imageURLs: ImageURLs - internalID: ID! - width: Int -} - -input ARImageInput { - internalID: ID! -} - type Article implements Node { # Maps to the "Primary Author" field in Positron. Ultimately this is only supposed to control the article slug author: Author @deprecated(reason: "Use `byline` or `authors` instead") @@ -1159,9 +1109,7 @@ type Article implements Node { publishedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String relatedArticles( @@ -1192,9 +1140,7 @@ type Article implements Node { updatedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String vertical: String @@ -1220,16 +1166,6 @@ type ArticleEdge { node: Article } -type ArticleFeaturedArtistNotificationItem { - article: Article - artistsConnection( - after: String - before: String - first: Int - last: Int - ): ArtistConnection -} - type ArticleFeatureSection { # Only YouTube and Vimeo are supported embed(autoPlay: Boolean = false): String @@ -1246,6 +1182,16 @@ enum ArticleFeatureSectionType { TEXT } +type ArticleFeaturedArtistNotificationItem { + article: Article + artistsConnection( + after: String + before: String + first: Int + last: Int + ): ArtistConnection +} + union ArticleHero = ArticleFeatureSection type ArticleImageSection { @@ -1272,9 +1218,7 @@ type ArticleMedia { releaseDate( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String url: String @@ -1343,15 +1287,6 @@ enum ArticleSectionImageSetLayout { MINI } -union ArticleSections = - ArticleSectionCallout - | ArticleSectionEmbed - | ArticleSectionImageCollection - | ArticleSectionImageSet - | ArticleSectionSocialEmbed - | ArticleSectionText - | ArticleSectionVideo - type ArticleSectionSocialEmbed { # oEmbed HTML response. Only Twitter is currently supported. embed: String @@ -1380,6 +1315,15 @@ enum ArticleSectionVideoLayout { OVERFLOW_FILLWIDTH } +union ArticleSections = + ArticleSectionCallout + | ArticleSectionEmbed + | ArticleSectionImageCollection + | ArticleSectionImageSet + | ArticleSectionSocialEmbed + | ArticleSectionText + | ArticleSectionVideo + type ArticleSeries { # HTML string describing the series description: String @@ -1531,7 +1475,7 @@ type Artist implements EntityWithFilterArtworksConnectionInterface & Node & Sear sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection # In applicable contexts, this is what the artist (as a suggestion) is based on. @@ -1562,9 +1506,7 @@ type Artist implements EntityWithFilterArtworksConnectionInterface & Node & Sear createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String criticallyAcclaimed: Boolean @@ -1888,7 +1830,7 @@ type ArtistInsight { # Number of entities relevant to the insight. count: Int! - description(format: Format): String + description(format: Format = PLAIN): String # List of entities relevant to the insight. entities: [String!]! @@ -2202,16 +2144,16 @@ type Artwork implements Node & Searchable & Sellable { shallow: Boolean ): Artist artistNames: String - artists( - # Use whatever is in the original response instead of making a request - shallow: Boolean - ): [Artist] artistSeriesConnection( after: String before: String first: Int last: Int ): ArtistSeriesConnection + artists( + # Use whatever is in the original response instead of making a request + shallow: Boolean + ): [Artist] artsyShippingDomestic: Boolean artsyShippingInternational: Boolean @@ -2227,9 +2169,7 @@ type Artwork implements Node & Searchable & Sellable { # Can a user request a lot conditions report for this artwork? canRequestLotConditionsReport: Boolean - # Represents the "**medium type**", such as _Painting_. (This field is also - # commonly referred to as just "medium", but should not be confused with the - # artwork attribute called `medium`.) + # Represents the "**medium type**", such as _Painting_. (This field is also commonly referred to as just "medium", but should not be confused with the artwork attribute called `medium`.) category: String @deprecated(reason: "Prefer to use `mediumType`.") # Returns the display label and detail when artwork has a certificate of authenticity @@ -2342,13 +2282,13 @@ type Artwork implements Node & Searchable & Sellable { size: Int ): Image imageRights: String + imageTitle: String + imageUrl: String images( # Show all images, even if they are not ready or processing failed. includeAll: Boolean size: Int ): [Image] - imageTitle: String - imageUrl: String # Represents the import source of the artwork importSource: ArtworkImportSource @@ -2396,11 +2336,11 @@ type Artwork implements Node & Searchable & Sellable { # Is this artwork part of an auction? isInAuction: Boolean - # Do we want to encourage inquiries on this work? - isInquireable: Boolean - # Is this artwork part of a current show isInShow: Boolean + + # Do we want to encourage inquiries on this work? + isInquireable: Boolean isNotForSale: String # Whether a user can make an offer on a work @@ -2432,14 +2372,10 @@ type Artwork implements Node & Searchable & Sellable { manufacturer(format: Format): String marketPriceInsights: ArtworkPriceInsights - # Represents the **materials** used in this work, such as _oil and acrylic on - # canvas_. (This should not be confused with the artwork attribute called - # `category`, which is commonly referred to as "medium" or "medium type") + # Represents the **materials** used in this work, such as _oil and acrylic on canvas_. (This should not be confused with the artwork attribute called `category`, which is commonly referred to as "medium" or "medium type") medium: String - # Represents the "**medium type**", such as _Painting_. (This field is also - # commonly referred to as just "medium", but should not be confused with the - # artwork attribute called `medium`.) + # Represents the "**medium type**", such as _Painting_. (This field is also commonly referred to as just "medium", but should not be confused with the artwork attribute called `medium`.) mediumType: ArtworkMedium meta: ArtworkMeta @@ -2471,9 +2407,7 @@ type Artwork implements Node & Searchable & Sellable { published: Boolean! publisher(format: Format): String - # Price which an artwork was sold for. This generally only applies to artworks - # in the target supply microfunnel and (currently) queries against hardcoded - # spreadsheet data. + # Price which an artwork was sold for. This generally only applies to artworks in the target supply microfunnel and (currently) queries against hardcoded spreadsheet data. realizedPrice: String realizedToEstimate: String @@ -2691,9 +2625,7 @@ type ArtworkLayer { type: String } -# Collection of fields that describe medium type, such as _Painting_. (This field -# is also commonly referred to as just "medium", but should not be confused with -# the artwork attribute called `medium`.) +# Collection of fields that describe medium type, such as _Painting_. (This field is also commonly referred to as just "medium", but should not be confused with the artwork attribute called `medium`.) type ArtworkMedium { # The medium gene that corresponds to this medium type. Used for filtering purposes on our frontend, e.g. in artwork grids. filterGene: Gene @@ -2769,12 +2701,6 @@ type ArtworkPublishedNotificationItem { ): ArtworkConnection } -# The results for one of the requested aggregations -type ArtworksAggregationResults { - counts: [AggregationCount] - slice: ArtworkAggregation -} - type ArtworkSavedSearch { # Based on the artworks attributes (usually considered for saved searches). suggestedArtworksConnection( @@ -2785,43 +2711,6 @@ type ArtworkSavedSearch { ): ArtworkConnection } -type ArtworksCollectionsBatchUpdateCounts { - addedToCollections: Int - artworks: Int - removedFromCollections: Int -} - -type ArtworksCollectionsBatchUpdateFailure { - mutationError: GravityMutationError -} - -input ArtworksCollectionsBatchUpdateInput { - # Collection ids. To which collections to add artworks. - addToCollectionIDs: [String!] - - # Artwork ids or slugs. - artworkIDs: [String!]! - clientMutationId: String - - # Collection ids. From which collections to remove artworks. - removeFromCollectionIDs: [String!] -} - -type ArtworksCollectionsBatchUpdatePayload { - clientMutationId: String - responseOrError: ArtworksCollectionsBatchUpdateResponseOrError -} - -union ArtworksCollectionsBatchUpdateResponseOrError = - ArtworksCollectionsBatchUpdateFailure - | ArtworksCollectionsBatchUpdateSuccess - -type ArtworksCollectionsBatchUpdateSuccess { - addedToCollections: [Collection] - counts: ArtworksCollectionsBatchUpdateCounts - removedFromCollections: [Collection] -} - enum ArtworkSizes { LARGE MEDIUM @@ -2885,6 +2774,49 @@ type ArtworkVersion implements Node { title: String } +# The results for one of the requested aggregations +type ArtworksAggregationResults { + counts: [AggregationCount] + slice: ArtworkAggregation +} + +type ArtworksCollectionsBatchUpdateCounts { + addedToCollections: Int + artworks: Int + removedFromCollections: Int +} + +type ArtworksCollectionsBatchUpdateFailure { + mutationError: GravityMutationError +} + +input ArtworksCollectionsBatchUpdateInput { + # Collection ids. To which collections to add artworks. + addToCollectionIDs: [String!] + + # Artwork ids or slugs. + artworkIDs: [String!]! + clientMutationId: String + + # Collection ids. From which collections to remove artworks. + removeFromCollectionIDs: [String!] +} + +type ArtworksCollectionsBatchUpdatePayload { + clientMutationId: String + responseOrError: ArtworksCollectionsBatchUpdateResponseOrError +} + +union ArtworksCollectionsBatchUpdateResponseOrError = + ArtworksCollectionsBatchUpdateFailure + | ArtworksCollectionsBatchUpdateSuccess + +type ArtworksCollectionsBatchUpdateSuccess { + addedToCollections: [Collection] + counts: ArtworksCollectionsBatchUpdateCounts + removedFromCollections: [Collection] +} + # Fields of an attachment (currently from Radiation) type Attachment { # Content type of file. @@ -2978,15 +2910,13 @@ type AuctionResult implements Node { date( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String dateText: String description: String - dimensions: AuctionLotDimensions dimensionText: String + dimensions: AuctionLotDimensions estimate: AuctionLotEstimate externalURL: String @@ -3007,9 +2937,7 @@ type AuctionResult implements Node { saleDate( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String saleDateText: String @@ -3054,6 +2982,13 @@ type AuctionResultPriceRealized { ): String } +enum AuctionResultSorts { + DATE_ASC + DATE_DESC + ESTIMATE_AND_DATE_DESC + PRICE_AND_DATE_DESC +} + enum AuctionResultsAggregation { CURRENCIES_COUNT LOTS_BY_CREATED_YEAR @@ -3126,19 +3061,18 @@ type AuctionResultsByArtistsEdge { node: AuctionResultsByArtists } -enum AuctionResultSorts { - DATE_ASC - DATE_DESC - ESTIMATE_AND_DATE_DESC - PRICE_AND_DATE_DESC -} - enum AuctionResultsState { ALL PAST UPCOMING } +enum AuctionState { + CLOSED + OPEN + UPCOMING +} + type AuctionsArtsyBidder { id: ID! paddleNumber: ID! @@ -3187,8 +3121,8 @@ input AuctionsIncrementPolicyChangeInput { # A groupTag and list of IncrementPolicySubgroups type AuctionsIncrementPolicyGroup { groupTag: ID! - subgroups: [AuctionsIncrementPolicySubgroup!]! subgroupTags: [ID!]! + subgroups: [AuctionsIncrementPolicySubgroup!]! } type AuctionsIncrementPolicySubgroup { @@ -3386,15 +3320,15 @@ type AuctionsSaleState { # Lot ids that had an Artsy bid that was the highest bid on the lot but did not win lotIdsWithHigherArtsyBidNotWon: [String!]! + # Lot ids that had an Artsy bid that was the same max bid as the hammer price on the lot but did not win + lotIdsWithSameArtsyBidNotWon: [String!]! + # Lot ids without a FairWarning event lotIdsWithoutFairWarning: [String!]! # Lot ids without a FinalCall event lotIdsWithoutFinalCall: [String!]! - # Lot ids that had an Artsy bid that was the same max bid as the hammer price on the lot but did not win - lotIdsWithSameArtsyBidNotWon: [String!]! - # The lots belonging to this sale. lots: [AuctionsLotState!]! @@ -3414,12 +3348,6 @@ enum AuctionsSoldStatus { Sold } -enum AuctionState { - CLOSED - OPEN - UPCOMING -} - # An Artsy User type AuctionsUser implements AuctionsNode { # The ID of an object @@ -3544,13 +3472,22 @@ enum BankAccountTypes { US_BANK_ACCOUNT } +type BidIncrement { + amount: Int + from: Int + to: Int +} + +type BidIncrementsFormatted { + cents: Float + display: String +} + type Bidder implements Node { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -3569,9 +3506,7 @@ type BidderPosition { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String highestBid: HighestBid @@ -3589,9 +3524,7 @@ type BidderPosition { processedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String saleArtwork: SaleArtwork @@ -3599,9 +3532,7 @@ type BidderPosition { updatedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String } @@ -3666,17 +3597,6 @@ type BidderPositionSuggestedNextBid { display: String } -type BidIncrement { - amount: Int - from: Int - to: Int -} - -type BidIncrementsFormatted { - cents: Float - display: String -} - # Represents non-fractional signed whole numeric values. Since the value may # exceed the size of a 32-bit integer, it's encoded as a string. scalar BigInt @@ -3860,7 +3780,7 @@ type City { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection slug: String! sponsoredContent: CitySponsoredContent @@ -3888,7 +3808,7 @@ type Collection { first: Int last: Int page: Int - sort: CollectionArtworkSorts + sort: CollectionArtworkSorts = SAVED_AT_DESC ): ArtworkConnection # Number of artworks associated with this collection. @@ -3909,8 +3829,7 @@ type Collection { # Checking whether artwork is included in collection isSavedArtwork(artworkID: String!): Boolean! - # Name of the collection. Has a predictable value for 'standard' collections - # such as Saved Artwork, My Collection, etc. Can be provided by user otherwise. + # Name of the collection. Has a predictable value for 'standard' collections such as Saved Artwork, My Collection, etc. Can be provided by user otherwise. name: String! # True if this collection represents artworks explicitly saved by the user, false otherwise. @@ -3924,6 +3843,13 @@ enum CollectionArtworkSorts { SAVED_AT_DESC } +enum CollectionSorts { + CREATED_AT_ASC + CREATED_AT_DESC + UPDATED_AT_ASC + UPDATED_AT_DESC +} + # A connection to a list of items. type CollectionsConnection { # A list of edges. @@ -3944,13 +3870,6 @@ type CollectionsEdge { node: Collection } -enum CollectionSorts { - CREATED_AT_ASC - CREATED_AT_DESC - UPDATED_AT_ASC - UPDATED_AT_DESC -} - type CollectorProfileArtists { name: String } @@ -3959,9 +3878,7 @@ type CollectorProfileType { artsyUserSince( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String bio: String @@ -3974,9 +3891,7 @@ type CollectorProfileType { confirmedBuyerAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String email: String @@ -4007,9 +3922,7 @@ type CollectorProfileType { loyaltyApplicantAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String name: String @@ -4024,17 +3937,13 @@ type CollectorProfileType { professionalBuyerAppliedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String professionalBuyerAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String selfReportedPurchases: String @@ -4573,11 +4482,8 @@ type CommerceCreateOrderWithArtworkPayload { orderOrError: CommerceOrderOrFailureUnion! } -# Autogenerated input type of CreatePartnerOfferOrderWithArtwork -input CommerceCreatePartnerOfferOrderWithArtworkInput { - # Artwork Id - artworkId: String! - +# Autogenerated input type of CreatePartnerOfferOrder +input CommerceCreatePartnerOfferOrderInput { # A unique identifier for the client performing the mutation. clientMutationId: String @@ -4591,8 +4497,8 @@ input CommerceCreatePartnerOfferOrderWithArtworkInput { quantity: Int } -# Autogenerated return type of CreatePartnerOfferOrderWithArtwork. -type CommerceCreatePartnerOfferOrderWithArtworkPayload { +# Autogenerated return type of CreatePartnerOfferOrder. +type CommerceCreatePartnerOfferOrderPayload { # A unique identifier for the client performing the mutation. clientMutationId: String @@ -5467,6 +5373,9 @@ enum CommerceOrderSourceEnum { # The order was originated on a conversation inquiry + # The order was originated from a partner offer + partner_offer + # The order was originated from a private sale private_sale } @@ -6019,8 +5928,8 @@ type Consignment { salePriceCents: Int state: ConsignmentState submission: ConsignmentSubmission! - submissionId: ID! submissionID: ID + submissionId: ID! } enum ConsignmentAttributionClass { @@ -6638,8 +6547,8 @@ type ConsignmentSubmissionCategoryAsset { # known image urls imageUrls: JSON size: String - submissionId: ID! submissionID: ID + submissionId: ID! } # The connection type for Submission. @@ -7110,25 +7019,19 @@ type Conversation implements Node { buyerOutcomeAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String deletedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -7172,9 +7075,7 @@ type Conversation implements Node { lastMessageAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -7363,32 +7264,6 @@ union CreateAccountRequestMutationType = CreateAccountRequestMutationFailure | CreateAccountRequestMutationSuccess -type createAdvisoryOpportunityFailure { - mutationError: GravityMutationError -} - -input createAdvisoryOpportunityMutationInput { - clientMutationId: String - message: String - phoneCountryCode: String - phoneNumber: String - searchCriteriaID: String! -} - -type createAdvisoryOpportunityMutationPayload { - # On success: the advisory opportunity - advisoryOpportunityOrError: createAdvisoryOpportunityResponseOrError - clientMutationId: String -} - -union createAdvisoryOpportunityResponseOrError = - createAdvisoryOpportunityFailure - | createAdvisoryOpportunitySuccess - -type createAdvisoryOpportunitySuccess { - advisoryOpportunity: AdvisoryOpportunity! -} - # Autogenerated input type of CreateAndSendBackupSecondFactor input CreateAndSendBackupSecondFactorInput { # A unique identifier for the client performing the mutation. @@ -7489,16 +7364,6 @@ type CreateCollectionFailure { mutationError: GravityMutationError } -input createCollectionInput { - clientMutationId: String - name: String! -} - -type createCollectionPayload { - clientMutationId: String - responseOrError: CreateCollectionResponseOrError -} - union CreateCollectionResponseOrError = CreateCollectionFailure | CreateCollectionSuccess @@ -7526,58 +7391,56 @@ union CreateConsignmentInquiryMutationType = ConsignmentInquiryMutationFailure | ConsignmentInquiryMutationSuccess -type CreateFeaturedLinkFailure { +type CreateFeatureFailure { mutationError: GravityMutationError } -input CreateFeaturedLinkMutationInput { +input CreateFeatureMutationInput { + active: Boolean! + callout: String clientMutationId: String description: String - href: String! + layout: FeatureLayouts + name: String! sourceBucket: String sourceKey: String - subtitle: String - title: String! + subheadline: String } -type CreateFeaturedLinkMutationPayload { +type CreateFeatureMutationPayload { clientMutationId: String - featuredLinkOrError: CreateFeaturedLinkResponseOrError + featureOrError: createFeatureResponseOrError } -union CreateFeaturedLinkResponseOrError = - CreateFeaturedLinkFailure - | CreateFeaturedLinkSuccess - -type CreateFeaturedLinkSuccess { - featuredLink: FeaturedLink +type CreateFeatureSuccess { + feature: Feature } -type CreateFeatureFailure { +type CreateFeaturedLinkFailure { mutationError: GravityMutationError } -input CreateFeatureMutationInput { - active: Boolean! - callout: String +input CreateFeaturedLinkMutationInput { clientMutationId: String description: String - layout: FeatureLayouts - name: String! + href: String! sourceBucket: String sourceKey: String - subheadline: String + subtitle: String + title: String! } -type CreateFeatureMutationPayload { +type CreateFeaturedLinkMutationPayload { clientMutationId: String - featureOrError: createFeatureResponseOrError + featuredLinkOrError: CreateFeaturedLinkResponseOrError } -union createFeatureResponseOrError = CreateFeatureFailure | CreateFeatureSuccess +union CreateFeaturedLinkResponseOrError = + CreateFeaturedLinkFailure + | CreateFeaturedLinkSuccess -type CreateFeatureSuccess { - feature: Feature +type CreateFeaturedLinkSuccess { + featuredLink: FeaturedLink } input CreateGeminiEntryForAssetInput { @@ -7601,10 +7464,6 @@ type CreateGeminiEntryForAssetPayload { clientMutationId: String } -type createHeroUnitFailure { - mutationError: GravityMutationError -} - input CreateHeroUnitLinkInput { text: String! url: String! @@ -7630,14 +7489,6 @@ type CreateHeroUnitMutationPayload { heroUnitOrError: createHeroUnitResponseOrError } -union createHeroUnitResponseOrError = - createHeroUnitFailure - | createHeroUnitSuccess - -type createHeroUnitSuccess { - heroUnit: HeroUnit -} - input CreateIdentityVerificationOverrideMutationInput { clientMutationId: String @@ -7732,10 +7583,6 @@ type CreateOfferResponseMutationPayload { consignmentOfferResponse: OfferResponse } -type createOrderedSetFailure { - mutationError: GravityMutationError -} - input CreateOrderedSetMutationInput { clientMutationId: String description: String @@ -7757,14 +7604,6 @@ type CreateOrderedSetMutationPayload { orderedSetOrError: createOrderedSetResponseOrError } -union createOrderedSetResponseOrError = - createOrderedSetFailure - | createOrderedSetSuccess - -type createOrderedSetSuccess { - set: OrderedSet -} - type CreatePageFailure { mutationError: GravityMutationError } @@ -7787,31 +7626,6 @@ type CreatePageSuccess { page: Page } -type createPartnerOfferFailure { - mutationError: GravityMutationError -} - -input createPartnerOfferMutationInput { - artwork_id: String! - clientMutationId: String - discount_percentage: Int -} - -type createPartnerOfferMutationPayload { - clientMutationId: String - - # On success: the partner offer created. - partnerOfferOrError: createPartnerOfferResponseOrError -} - -union createPartnerOfferResponseOrError = - createPartnerOfferFailure - | createPartnerOfferSuccess - -type createPartnerOfferSuccess { - partnerOffer: PartnerOffer -} - # Autogenerated input type of CreateSavedSearch input CreateSavedSearchInput { attributes: SearchCriteriaAttributes! @@ -7918,38 +7732,10 @@ type CreateUserAddressPayload { userAddressOrErrors: UserAddressOrErrorsUnion! } -type createUserAdminNoteFailure { - mutationError: GravityMutationError -} - -input createUserAdminNoteMutationInput { - body: String! - clientMutationId: String - id: String! -} - -type createUserAdminNoteMutationPayload { - # On success: the admin note created. - adminNoteOrError: createUserAdminNoteResponseOrError - clientMutationId: String -} - -union createUserAdminNoteResponseOrError = - createUserAdminNoteFailure - | createUserAdminNoteSuccess - -type createUserAdminNoteSuccess { - adminNote: UserAdminNotes -} - type CreateUserInterestFailure { mutationError: GravityMutationError } -type createUserInterestForUserFailure { - mutationError: GravityMutationError -} - input CreateUserInterestForUserInput { # Optional body for a note. body: String @@ -7968,15 +7754,6 @@ type CreateUserInterestForUserPayload { userInterestOrError: createUserInterestForUserResponseOrError } -union createUserInterestForUserResponseOrError = - createUserInterestForUserFailure - | createUserInterestForUserSuccess - -type createUserInterestForUserSuccess { - user: User - userInterest: UserInterest -} - input CreateUserInterestMutationInput { anonymousSessionId: String @@ -8079,10 +7856,10 @@ input CreateViewingRoomInput { # Introduction introStatement: String + partnerID: String # Partner Id partnerId: String - partnerID: String # Pullquote pullQuote: String @@ -8328,18 +8105,6 @@ type DeleteCollectionFailure { mutationError: GravityMutationError } -input deleteCollectionInput { - clientMutationId: String - id: String! -} - -type deleteCollectionPayload { - clientMutationId: String - - # On success: the deleted collection - responseOrError: DeleteCollectionResponseOrError -} - union DeleteCollectionResponseOrError = DeleteCollectionFailure | DeleteCollectionSuccess @@ -8385,28 +8150,6 @@ type DeleteCreditCardPayload { me: Me } -type DeleteFeaturedLinkFailure { - mutationError: GravityMutationError -} - -input DeleteFeaturedLinkMutationInput { - clientMutationId: String - id: String! -} - -type DeleteFeaturedLinkMutationPayload { - clientMutationId: String - featuredLinkOrError: DeleteFeaturedLinkResponseOrError -} - -union DeleteFeaturedLinkResponseOrError = - DeleteFeaturedLinkFailure - | DeleteFeaturedLinkSuccess - -type DeleteFeaturedLinkSuccess { - featuredLink: FeaturedLink -} - type DeleteFeatureFailure { mutationError: GravityMutationError } @@ -8427,78 +8170,26 @@ type DeleteFeatureSuccess { feature: Feature } -type deleteHeroUnitFailure { - mutationError: GravityMutationError -} - -input deleteHeroUnitMutationInput { - clientMutationId: String - id: String! -} - -type deleteHeroUnitMutationPayload { - clientMutationId: String - - # On success: the deleted hero unit. - heroUnitOrError: deleteHeroUnitResponseOrError -} - -union deleteHeroUnitResponseOrError = - deleteHeroUnitFailure - | deleteHeroUnitSuccess - -type deleteHeroUnitSuccess { - heroUnit: HeroUnit -} - -type deleteOrderedSetFailure { - mutationError: GravityMutationError -} - -type deleteOrderedSetItemFailure { +type DeleteFeaturedLinkFailure { mutationError: GravityMutationError } -input deleteOrderedSetItemMutationInput { - clientMutationId: String - id: String! - itemId: String! -} - -type deleteOrderedSetItemMutationPayload { - clientMutationId: String - - # On success: the updated parent set or the set item deleted. - deleteOrderedSetItemResponseOrError: deleteOrderedSetItemResponseOrError -} - -union deleteOrderedSetItemResponseOrError = - deleteOrderedSetItemFailure - | deleteOrderedSetItemSuccess - -type deleteOrderedSetItemSuccess { - set: OrderedSet - setItem: OrderedSetItem -} - -input deleteOrderedSetMutationInput { +input DeleteFeaturedLinkMutationInput { clientMutationId: String id: String! } -type deleteOrderedSetMutationPayload { +type DeleteFeaturedLinkMutationPayload { clientMutationId: String - - # On success: the deleted ordered set. - orderedSetOrError: deleteOrderedSetResponseOrError + featuredLinkOrError: DeleteFeaturedLinkResponseOrError } -union deleteOrderedSetResponseOrError = - deleteOrderedSetFailure - | deleteOrderedSetSuccess +union DeleteFeaturedLinkResponseOrError = + DeleteFeaturedLinkFailure + | DeleteFeaturedLinkSuccess -type deleteOrderedSetSuccess { - set: OrderedSet +type DeleteFeaturedLinkSuccess { + featuredLink: FeaturedLink } type DeletePageFailure { @@ -8536,30 +8227,6 @@ type DeleteUserAddressPayload { userAddressOrErrors: UserAddressOrErrorsUnion! } -type deleteUserAdminNoteFailure { - mutationError: GravityMutationError -} - -input deleteUserAdminNoteMutationInput { - adminNoteId: String! - clientMutationId: String - id: String! -} - -type deleteUserAdminNoteMutationPayload { - # On success: the admin note deleted. - adminNoteOrError: deleteUserAdminNoteResponseOrError - clientMutationId: String -} - -union deleteUserAdminNoteResponseOrError = - deleteUserAdminNoteFailure - | deleteUserAdminNoteSuccess - -type deleteUserAdminNoteSuccess { - adminNote: UserAdminNotes -} - type DeleteUserFailure { mutationError: GravityMutationError } @@ -8582,10 +8249,6 @@ type DeleteUserInterestFailure { mutationError: GravityMutationError } -type deleteUserInterestForUserFailure { - mutationError: GravityMutationError -} - input DeleteUserInterestForUserInput { clientMutationId: String @@ -8603,15 +8266,6 @@ type DeleteUserInterestForUserPayload { userInterestOrError: deleteUserInterestForUserResponseOrError } -union deleteUserInterestForUserResponseOrError = - deleteUserInterestForUserFailure - | deleteUserInterestForUserSuccess - -type deleteUserInterestForUserSuccess { - user: User - userInterest: UserInterest -} - input DeleteUserInterestMutationInput { anonymousSessionId: String clientMutationId: String @@ -8649,31 +8303,6 @@ type DeleteUserPayload { union DeleteUserResponseOrError = DeleteUserFailure | DeleteUserSuccess -type deleteUserRoleFailure { - mutationError: GravityMutationError -} - -input deleteUserRoleMutationInput { - clientMutationId: String - id: String! - role_type: String! -} - -type deleteUserRoleMutationPayload { - clientMutationId: String - - # On success: the user. - userOrError: deleteUserRoleResponseOrError -} - -union deleteUserRoleResponseOrError = - deleteUserRoleFailure - | deleteUserRoleSuccess - -type deleteUserRoleSuccess { - user: User -} - type DeleteUserSuccess { user: User } @@ -8735,25 +8364,19 @@ type Delivery { bouncedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String clickedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String deliveredAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -8768,9 +8391,7 @@ type Delivery { openedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String } @@ -8801,11 +8422,6 @@ type Device { token: String! } -type dimensions { - cm: String - in: String -} - # Autogenerated input type of DisableSavedSearch input DisableSavedSearchInput { # A unique identifier for the client performing the mutation. @@ -8850,16 +8466,16 @@ type DislikeArtworkPayload { } type DoNotUseThisPartner { - display_name: String @deprecated(reason: "Use displayName") displayName: String - given_name: String @deprecated(reason: "Use givenName") + display_name: String @deprecated(reason: "Use displayName") givenName: String + given_name: String @deprecated(reason: "Use givenName") id: ID! - relative_size: Int @deprecated(reason: "Use relativeSize") relativeSize: Int + relative_size: Int @deprecated(reason: "Use relativeSize") slug: String - subscription_state: String @deprecated(reason: "Use subscriptionState") subscriptionState: String + subscription_state: String @deprecated(reason: "Use subscriptionState") } input EditableLocation { @@ -9106,9 +8722,7 @@ type ExternalFair { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -9121,9 +8735,7 @@ type ExternalFair { startAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String } @@ -9157,9 +8769,7 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { activeStartAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String articlesConnection( @@ -9190,16 +8800,14 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String # The exhibitors with booths in this fair with letter. @@ -9292,8 +8900,8 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { isReverseImageSearchEnabled: Boolean! links(format: Format): String location: Location - marketingCollections(size: Int): [MarketingCollection]! marketingCollectionSlugs: [String]! + marketingCollections(size: Int): [MarketingCollection]! mobileImage: Image name: String organizer: FairOrganizer @@ -9321,9 +8929,7 @@ type Fair implements EntityWithFilterArtworksConnectionInterface & Node { startAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String summary(format: Format): String @@ -9359,12 +8965,12 @@ type FairCounts { format: String label: String ): FormattedNumber - partners( + partnerShows( # Returns a `String` when format is specified. e.g.`'0,0.0000''` format: String label: String ): FormattedNumber - partnerShows( + partners( # Returns a `String` when format is specified. e.g.`'0,0.0000''` format: String label: String @@ -9480,7 +9086,7 @@ type Feature { before: String first: Int last: Int - sort: OrderedSetSorts + sort: OrderedSetSorts = KEY_ASC ): OrderedSetConnection # A slug ID. @@ -9499,54 +9105,6 @@ type FeatureConnection { totalCount: Int } -# An illustrated link chosen to highlight a Gene from a given GeneFamily -type FeaturedGeneLink { - href: String! - image: Image - internalID: String! - title: String! -} - -type FeaturedLink { - description(format: Format): String - - # Parses the `href` to get the underlying entity - entity: FeaturedLinkEntity - href: String - - # A globally unique ID. - id: ID! - image: Image - initials(length: Int = 3): String - - # A type-specific ID likely used as a database ID. - internalID: ID! - subtitle(format: Format): String - title: String -} - -# A connection to a list of items. -type FeaturedLinkConnection { - # A list of edges. - edges: [FeaturedLinkEdge] - pageCursors: PageCursors! - - # Information to aid in pagination. - pageInfo: PageInfo! - totalCount: Int -} - -# An edge in a connection. -type FeaturedLinkEdge { - # A cursor for use in pagination - cursor: String! - - # The item at the end of the edge - node: FeaturedLink -} - -union FeaturedLinkEntity = Artist | Gene | Partner - # An edge in a connection. type FeatureEdge { # A cursor for use in pagination @@ -9560,9 +9118,7 @@ type FeatureFlag { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String description: String @@ -9575,9 +9131,7 @@ type FeatureFlag { lastSeenAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String name: String! @@ -9592,11 +9146,6 @@ type FeatureFlagEnvironments { name: String! } -enum FeatureFlagsSortBy { - CREATED_AT - NAME -} - input FeatureFlagStrategyInput { rollOut: Int = 100 strategyType: FeatureFlagStrategyType @@ -9633,6 +9182,11 @@ enum FeatureFlagVariantWeightType { VARIABLE } +enum FeatureFlagsSortBy { + CREATED_AT + NAME +} + enum FeatureLayouts { DEFAULT FULL @@ -9652,9 +9206,57 @@ enum FeatureSorts { NAME_DESC } -type Feedback { - # A globally unique ID. - id: ID! +# An illustrated link chosen to highlight a Gene from a given GeneFamily +type FeaturedGeneLink { + href: String! + image: Image + internalID: String! + title: String! +} + +type FeaturedLink { + description(format: Format): String + + # Parses the `href` to get the underlying entity + entity: FeaturedLinkEntity + href: String + + # A globally unique ID. + id: ID! + image: Image + initials(length: Int = 3): String + + # A type-specific ID likely used as a database ID. + internalID: ID! + subtitle(format: Format): String + title: String +} + +# A connection to a list of items. +type FeaturedLinkConnection { + # A list of edges. + edges: [FeaturedLinkEdge] + pageCursors: PageCursors! + + # Information to aid in pagination. + pageInfo: PageInfo! + totalCount: Int +} + +# An edge in a connection. +type FeaturedLinkEdge { + # A cursor for use in pagination + cursor: String! + + # The item at the end of the edge + node: FeaturedLink +} + +union FeaturedLinkEntity = Artist | Gene | Partner + +type Feedback { + # A globally unique ID. + id: ID! # A type-specific ID likely used as a database ID. internalID: ID! @@ -9861,6 +9463,69 @@ type FollowArtists { counts: FollowArtistCounts } +type FollowGene { + gene: Gene + + # A globally unique ID. + id: ID! + + # A type-specific ID likely used as a database ID. + internalID: ID! +} + +# A connection to a list of items. +type FollowGeneConnection { + # A list of edges. + edges: [FollowGeneEdge] + pageCursors: PageCursors! + + # Information to aid in pagination. + pageInfo: PageInfo! + totalCount: Int +} + +# An edge in a connection. +type FollowGeneEdge { + # A cursor for use in pagination + cursor: String! + + # The item at the end of the edge + node: FollowGene +} + +input FollowGeneInput { + clientMutationId: String + geneID: String + unfollow: Boolean = false +} + +type FollowGenePayload { + clientMutationId: String + gene: Gene +} + +input FollowProfileInput { + clientMutationId: String + profileID: String + unfollow: Boolean = false +} + +type FollowProfilePayload { + clientMutationId: String + profile: Profile +} + +input FollowShowInput { + clientMutationId: String + partnerShowID: String + unfollow: Boolean = false +} + +type FollowShowPayload { + clientMutationId: String + show: Show +} + type FollowedArtistsArtworksGroup implements Node { artists: String artworksConnection( @@ -9877,9 +9542,7 @@ type FollowedArtistsArtworksGroup implements Node { publishedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String summary: String @@ -9991,58 +9654,6 @@ type FollowedShowEdge { node: Show } -type FollowGene { - gene: Gene - - # A globally unique ID. - id: ID! - - # A type-specific ID likely used as a database ID. - internalID: ID! -} - -# A connection to a list of items. -type FollowGeneConnection { - # A list of edges. - edges: [FollowGeneEdge] - pageCursors: PageCursors! - - # Information to aid in pagination. - pageInfo: PageInfo! - totalCount: Int -} - -# An edge in a connection. -type FollowGeneEdge { - # A cursor for use in pagination - cursor: String! - - # The item at the end of the edge - node: FollowGene -} - -input FollowGeneInput { - clientMutationId: String - geneID: String - unfollow: Boolean = false -} - -type FollowGenePayload { - clientMutationId: String - gene: Gene -} - -input FollowProfileInput { - clientMutationId: String - profileID: String - unfollow: Boolean = false -} - -type FollowProfilePayload { - clientMutationId: String - profile: Profile -} - type FollowsAndSaves { # A Connection of followed artists by current user artistsConnection( @@ -10062,7 +9673,7 @@ type FollowsAndSaves { page: Int private: Boolean = false size: Int - sort: CollectionArtworkSorts + sort: CollectionArtworkSorts = POSITION_DESC ): SavedArtworksConnection # A list of published artworks by followed artists (grouped by date and artists). @@ -10127,17 +9738,6 @@ type FollowsAndSaves { ): FollowedShowConnection } -input FollowShowInput { - clientMutationId: String - partnerShowID: String - unfollow: Boolean = false -} - -type FollowShowPayload { - clientMutationId: String - show: Show -} - enum Format { HTML MARKDOWN @@ -10149,8 +9749,7 @@ type FormattedDaySchedules { hours: String } -# The `FormattedNumber` type represents a number that can optionally be returnedas -# a formatted String. It does not try to coerce the type. +# The `FormattedNumber` type represents a number that can optionally be returnedas a formatted String. It does not try to coerce the type. scalar FormattedNumber # An entry from gemini @@ -10338,9 +9937,7 @@ type HeroUnit { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10349,9 +9946,7 @@ type HeroUnit { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10373,9 +9968,7 @@ type HeroUnit { startAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10427,9 +10020,7 @@ type HighestBid { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String display: String @@ -10671,13 +10262,14 @@ type HomePageSalesModule { results: [Sale]! } +# An ISO 8601-encoded datetime +scalar ISO8601DateTime + type IdentityVerification { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10695,9 +10287,7 @@ type IdentityVerification { invitationExpiresAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10750,9 +10340,7 @@ type IdentityVerificationEmail { created_at( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10773,9 +10361,7 @@ type IdentityVerificationEmail { updated_at( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10801,9 +10387,7 @@ type IdentityVerificationOverride { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String creator: User @@ -10837,9 +10421,7 @@ type IdentityVerificationScanReference { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String extractedFirstName: String @@ -10849,9 +10431,7 @@ type IdentityVerificationScanReference { finishedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -10950,9 +10530,7 @@ type InquirerCollectorProfile { artsyUserSince( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String bio: String @@ -10965,9 +10543,7 @@ type InquirerCollectorProfile { confirmedBuyerAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String email: String @@ -11001,9 +10577,7 @@ type InquirerCollectorProfile { loyaltyApplicantAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String name: String @@ -11018,17 +10592,13 @@ type InquirerCollectorProfile { professionalBuyerAppliedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String professionalBuyerAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String selfReportedPurchases: String @@ -11142,10 +10712,10 @@ type InventoryHoldItemEdge { } # A hold or error object -union InventoryHoldOrErrorsUnion = Errors | InventoryHold +union InventoryHoldOrErrorUnion = Error | InventoryHold # A hold or error object -union InventoryHoldOrErrorUnion = Error | InventoryHold +union InventoryHoldOrErrorsUnion = Errors | InventoryHold # Fields of an invoice (currently from Lewitt) type Invoice implements Node { @@ -11202,8 +10772,8 @@ enum InvoiceState { VOID } -# An ISO 8601-encoded datetime -scalar ISO8601DateTime +# Represents untyped JSON +scalar JSON type Job { # HTML of job listing @@ -11217,16 +10787,11 @@ type Job { updatedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String } -# Represents untyped JSON -scalar JSON - type LatLng { lat: Float lng: Float @@ -11277,10 +10842,10 @@ type Location { city: String coordinates: LatLng country: String - daySchedules: [DaySchedule] # Alternate Markdown-supporting free text representation of a location's opening hours dayScheduleText: String + daySchedules: [DaySchedule] display: String displayCountry: String @@ -11394,135 +10959,54 @@ type MarkAllNotificationsAsReadSuccess { success: Boolean } -type MarkdownContent { - content(format: Format): String +type MarkNotificationAsReadFailure { + mutationError: GravityMutationError } -type MarketingCollection { - artworksConnection( - acquireable: Boolean - additionalGeneIDs: [String] - after: String - aggregationPartnerCities: [String] - aggregations: [ArtworkAggregation] - artistID: String - artistIDs: [String] - artistNationalities: [String] - artistSeriesID: String - artistSeriesIDs: [String] - atAuction: Boolean - attributionClass: [String] - before: String - color: String - colors: [String] - dimensionRange: String - excludeArtworkIDs: [String] - extraAggregationGeneIDs: [String] - first: Int - forSale: Boolean - geneID: String - geneIDs: [String] - height: String - includeArtworksByFollowedArtists: Boolean - includeMediumFilterInAggregation: Boolean - input: FilterArtworksInput - inquireableOnly: Boolean - keyword: String - keywordMatchExact: Boolean - last: Int - locationCities: [String] - majorPeriods: [String] - marketable: Boolean - marketingCollectionID: String - materialsTerms: [String] - medium: String - offerable: Boolean - page: Int - partnerCities: [String] - partnerID: ID - partnerIDs: [String] - period: String - periods: [String] - priceRange: String - saleID: ID - size: Int - sizes: [ArtworkSizes] - sort: String - tagID: String - width: String - ): FilterArtworksConnection - category: String! - createdAt: ISO8601DateTime! - credit: String - description: String - descriptionMarkdown: String - featuredArtistExclusionIds: [String!]! - headerImage: String - - # Unique ID for this marketing collection - id: ID! - - # Unique ID for this marketing collection - internalID: ID! - - # Returns true if this collection has linked collections with members - isDepartment: Boolean! - isFeaturedArtistContent: Boolean! - linkedCollections: [MarketingCollectionGroup!]! - priceGuidance: Float - query: MarketingCollectionQuery! - - # Returns collections by the same artist if more than 4 exist, otherwise returns collections from the same category - relatedCollections(size: Int = 10): [MarketingCollection!]! +input MarkNotificationAsReadInput { + clientMutationId: String + id: String! +} - # ID of an artwork with highest merchandis ability - representativeArtworkID: String +type MarkNotificationAsReadPayload { + clientMutationId: String + responseOrError: MarkNotificationAsReadResponseOrError +} - # Show featured artists section in header. Defaults to true - showFeaturedArtists: Boolean! +union MarkNotificationAsReadResponseOrError = + MarkNotificationAsReadFailure + | MarkNotificationAsReadSuccess - # Show artworks rail in header. Defaults to true - showHeaderArtworksRail: Boolean! - slug: String! - thumbnail: String - @deprecated( - reason: "If querying via Metaphysics use thumbnailImage instead." - ) - thumbnailImage: Image - title: String! - updatedAt: ISO8601DateTime! +type MarkNotificationAsReadSuccess { + success: Boolean } -type MarketingCollectionCategory { - collections: [MarketingCollection!]! - name: String! +type MarkNotificationsAsSeenFailure { + mutationError: GravityMutationError } -type MarketingCollectionGroup { - groupType: MarketingCollectionGroupTypeEnum! - internalID: ID! - members: [MarketingCollection!]! - name: String! +input MarkNotificationsAsSeenInput { + clientMutationId: String + + # Until what point of time notifications were seen. ISO8601 standard-formatted string. + until: String! } -enum MarketingCollectionGroupTypeEnum { - # Artist-focused collections, not to be confused with actual ArtistSeries - ArtistSeries - FeaturedCollections - OtherCollections +type MarkNotificationsAsSeenPayload { + clientMutationId: String + responseOrError: MarkNotificationsAsSeenResponseOrError } -type MarketingCollectionQuery { - artistIDs: [String!] - geneIDs: [String!] +union MarkNotificationsAsSeenResponseOrError = + MarkNotificationsAsSeenFailure + | MarkNotificationsAsSeenSuccess - # Is always null, will be eliminated later - id: ID +type MarkNotificationsAsSeenSuccess { + success: Boolean +} - # Is always null, will be eliminated later - internalID: ID - keyword: String - tagID: String +type MarkdownContent { + content(format: Format): String } # Market Price Insights @@ -11591,50 +11075,131 @@ type MarketPriceInsightsEdge { node: MarketPriceInsights } -type MarkNotificationAsReadFailure { - mutationError: GravityMutationError -} +type MarketingCollection { + artworksConnection( + acquireable: Boolean + additionalGeneIDs: [String] + after: String + aggregationPartnerCities: [String] + aggregations: [ArtworkAggregation] + artistID: String + artistIDs: [String] + artistNationalities: [String] + artistSeriesID: String + artistSeriesIDs: [String] + atAuction: Boolean + attributionClass: [String] + before: String + color: String + colors: [String] + dimensionRange: String + excludeArtworkIDs: [String] + extraAggregationGeneIDs: [String] + first: Int + forSale: Boolean + geneID: String + geneIDs: [String] + height: String + includeArtworksByFollowedArtists: Boolean + includeMediumFilterInAggregation: Boolean + input: FilterArtworksInput + inquireableOnly: Boolean + keyword: String + keywordMatchExact: Boolean + last: Int + locationCities: [String] + majorPeriods: [String] + marketable: Boolean + marketingCollectionID: String + materialsTerms: [String] + medium: String + offerable: Boolean + page: Int + partnerCities: [String] + partnerID: ID + partnerIDs: [String] + period: String + periods: [String] + priceRange: String + saleID: ID + size: Int + sizes: [ArtworkSizes] + sort: String + tagID: String + width: String + ): FilterArtworksConnection + category: String! + createdAt: ISO8601DateTime! + credit: String + description: String + descriptionMarkdown: String + featuredArtistExclusionIds: [String!]! + headerImage: String -input MarkNotificationAsReadInput { - clientMutationId: String - id: String! -} + # Unique ID for this marketing collection + id: ID! -type MarkNotificationAsReadPayload { - clientMutationId: String - responseOrError: MarkNotificationAsReadResponseOrError -} + # Unique ID for this marketing collection + internalID: ID! -union MarkNotificationAsReadResponseOrError = - MarkNotificationAsReadFailure - | MarkNotificationAsReadSuccess + # Returns true if this collection has linked collections with members + isDepartment: Boolean! + isFeaturedArtistContent: Boolean! + linkedCollections: [MarketingCollectionGroup!]! + priceGuidance: Float + query: MarketingCollectionQuery! -type MarkNotificationAsReadSuccess { - success: Boolean -} + # Returns collections by the same artist if more than 4 exist, otherwise returns collections from the same category + relatedCollections(size: Int = 10): [MarketingCollection!]! -type MarkNotificationsAsSeenFailure { - mutationError: GravityMutationError + # ID of an artwork with highest merchandis ability + representativeArtworkID: String + + # Show featured artists section in header. Defaults to true + showFeaturedArtists: Boolean! + + # Show artworks rail in header. Defaults to true + showHeaderArtworksRail: Boolean! + slug: String! + thumbnail: String + @deprecated( + reason: "If querying via Metaphysics use thumbnailImage instead." + ) + thumbnailImage: Image + title: String! + updatedAt: ISO8601DateTime! } -input MarkNotificationsAsSeenInput { - clientMutationId: String +type MarketingCollectionCategory { + collections: [MarketingCollection!]! + name: String! +} - # Until what point of time notifications were seen. ISO8601 standard-formatted string. - until: String! +type MarketingCollectionGroup { + groupType: MarketingCollectionGroupTypeEnum! + internalID: ID! + members: [MarketingCollection!]! + name: String! } -type MarkNotificationsAsSeenPayload { - clientMutationId: String - responseOrError: MarkNotificationsAsSeenResponseOrError +enum MarketingCollectionGroupTypeEnum { + # Artist-focused collections, not to be confused with actual ArtistSeries + ArtistSeries + FeaturedCollections + OtherCollections } -union MarkNotificationsAsSeenResponseOrError = - MarkNotificationsAsSeenFailure - | MarkNotificationsAsSeenSuccess +type MarketingCollectionQuery { + artistIDs: [String!] + geneIDs: [String!] -type MarkNotificationsAsSeenSuccess { - success: Boolean + # Is always null, will be eliminated later + id: ID + + # Is always null, will be eliminated later + internalID: ID + keyword: String + tagID: String } union Match = @@ -11734,7 +11299,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection auctionsLotStandingConnection( after: String @@ -11770,6 +11335,9 @@ type Me implements Node { saleID: String ): [BidderPosition] + # The current user's status relating to bids on artworks + bidderStatus(artworkID: String!, saleID: String!): LotStanding + # A list of the current user’s bidder registrations bidders( # Limit results to bidders in active auctions @@ -11778,9 +11346,6 @@ type Me implements Node { # The slug or ID of a Sale saleID: String ): [Bidder] - - # The current user's status relating to bids on artworks - bidderStatus(artworkID: String!, saleID: String!): LotStanding bio: String # Whether user is allowed to request email confirmation @@ -11824,15 +11389,13 @@ type Me implements Node { last: Int partnerId: String toBeReplied: Boolean - type: ConversationsInputMode + type: ConversationsInputMode = USER ): ConversationConnection counts: MeCounts createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -11905,10 +11468,33 @@ type Me implements Node { lengthUnitPreference: LengthUnitPreference! location: MyLocation - # Sale Artworks search results - lotsByFollowedArtistsConnection( - after: String - + # The current user's status relating to bids on artworks + lotStanding( + artworkID: String + saleArtworkID: String + saleID: String + ): LotStanding + + # A list of the current user's auction standings for given lots + lotStandings( + # Only includes lots on which you have a leading bidder position. + activePositions: Boolean + + # Only the lot standings on a specific artwork + artworkID: String + + # Only the lot standings for currently open or closed auctions. + live: Boolean + saleArtworkID: String + + # Only the lot standings for a specific auction + saleID: String + ): [LotStanding] + + # Sale Artworks search results + lotsByFollowedArtistsConnection( + after: String + # Please make sure to supply the TOTAL aggregation if you will be setting any aggregations aggregations: [SaleArtworkAggregation] artistIDs: [String] @@ -11934,29 +11520,6 @@ type Me implements Node { sort: String userId: String ): SaleArtworksConnection - - # The current user's status relating to bids on artworks - lotStanding( - artworkID: String - saleArtworkID: String - saleID: String - ): LotStanding - - # A list of the current user's auction standings for given lots - lotStandings( - # Only includes lots on which you have a leading bidder position. - activePositions: Boolean - - # Only the lot standings on a specific artwork - artworkID: String - - # Only the lot standings for currently open or closed auctions. - live: Boolean - saleArtworkID: String - - # Only the lot standings for a specific auction - saleID: String - ): [LotStanding] myBids: MyBids # A list of auction results from artists in My Collection @@ -11989,7 +11552,7 @@ type Me implements Node { sort: AuctionResultSorts # State of the returned auction results (can be past, upcoming, or all) - state: AuctionResultsState + state: AuctionResultsState = ALL ): AuctionResultConnection myCollectionConnection( after: String @@ -12006,8 +11569,7 @@ type Me implements Node { size: Int sort: MyCollectionArtworkSorts - # Sort by most recent price insight updates, filter out artworks without - # insights and return artworks uniq by artist & medium. + # Sort by most recent price insight updates, filter out artworks without insights and return artworks uniq by artist & medium. sortByLastAuctionResultDate: Boolean = false ): MyCollectionConnection @@ -12162,10 +11724,10 @@ type Me implements Node { before: String first: Int last: Int - sort: ShowSorts + sort: ShowSorts = CREATED_AT_DESC # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # A list of shows for the user (pagination logic might be broken) @@ -12183,10 +11745,10 @@ type Me implements Node { # Include shows within a radius of the provided location near: Near - sort: ShowSorts + sort: ShowSorts = CREATED_AT_DESC # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # A list of artworks similar to recently viewed artworks. @@ -12275,8 +11837,7 @@ input MergeArtistsMutationInput { badIds: [String!]! clientMutationId: String - # The database ID of the "good" artist record, which will be **kept** after the - # merge. Relevant fields and associations from the bad records will be merged into this one. + # The database ID of the "good" artist record, which will be **kept** after the merge. Relevant fields and associations from the bad records will be merged into this one. goodId: String! # A map describing the field-level overrides that should be part of this merge. @@ -12286,8 +11847,7 @@ input MergeArtistsMutationInput { type MergeArtistsMutationPayload { clientMutationId: String - # On success: the "good" artist record, which was kept after the merge. Upon a - # successful merge this record may have been updated. + # On success: the "good" artist record, which was kept after the merge. Upon a successful merge this record may have been updated. mergeArtistsResponseOrError: MergeArtistsResponseOrError } @@ -12309,9 +11869,7 @@ type Message implements Node { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String deliveries: [Delivery] @@ -12426,14 +11984,14 @@ type Mutation { acceptPartnerAgreement( input: AcceptPartnerAgreementInput! ): AcceptPartnerAgreementPayload - addAssetsToConsignmentSubmission( - # Parameters for AddAssetsToConsignmentSubmission - input: AddAssetsToConsignmentSubmissionInput! - ): AddAssetsToConsignmentSubmissionPayload addAssetToConsignmentSubmission( # Parameters for AddAssetToConsignmentSubmission input: AddAssetToConsignmentSubmissionInput! ): AddAssetToConsignmentSubmissionPayload + addAssetsToConsignmentSubmission( + # Parameters for AddAssetsToConsignmentSubmission + input: AddAssetsToConsignmentSubmissionInput! + ): AddAssetsToConsignmentSubmissionPayload # adds an item to an ordered set. addOrderedSetItem( @@ -12556,10 +12114,10 @@ type Mutation { ): CommerceCreateOrderWithArtworkPayload # Creates a buy Order with partner_offer as source. - commerceCreatePartnerOfferOrderWithArtwork( - # Parameters for CreatePartnerOfferOrderWithArtwork - input: CommerceCreatePartnerOfferOrderWithArtworkInput! - ): CommerceCreatePartnerOfferOrderWithArtworkPayload + commerceCreatePartnerOfferOrder( + # Parameters for CreatePartnerOfferOrder + input: CommerceCreatePartnerOfferOrderInput! + ): CommerceCreatePartnerOfferOrderPayload # Fixes a failed payment. Essentially, it will update the credit card on the order and attempt to approve it again. commerceFixFailedPayment( @@ -13373,9 +12931,7 @@ type Notification implements Node { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @deprecated(reason: "Please use `publishedAt` instead") @@ -13489,14 +13045,14 @@ type OpeningHoursText { union OpeningHoursUnion = OpeningHoursArray | OpeningHoursText +union OrderParty = Partner | User + type OrderedSet { cached: Int createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String createdBy: User @@ -13508,6 +13064,7 @@ type OrderedSet { # A type-specific ID. internalID: ID! internalName: String + itemType: String items: [OrderedSetItem] # Returns a connection of the items. Only Artwork supported right now. @@ -13518,7 +13075,6 @@ type OrderedSet { last: Int ): ArtworkConnection @deprecated(reason: "Utilize `orderedItemsConnection` for union type") - itemType: String key: String layout: OrderedSetLayouts! name: String @@ -13605,8 +13161,6 @@ enum OrderedSetSorts { OWNER_TYPE_DESC } -union OrderParty = Partner | User - type Page { content(format: Format): String @@ -13762,8 +13316,7 @@ type Partner implements Node { # Return artworks that were saved by collectors at least one time. savedAtLeastOnce: Boolean - # Only allowed for authorized admin/partner requests. When false fetch :all - # properties on an artwork, when true or not present fetch artwork :short properties + # Only allowed for authorized admin/partner requests. When false fetch :all properties on an artwork, when true or not present fetch artwork :short properties shallow: Boolean sort: ArtworkSorts ): ArtworkConnection @@ -13940,7 +13493,7 @@ type Partner implements Node { sort: ShowSorts # Filter shows by chronological event status - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection showsSearchConnection( after: String @@ -14262,8 +13815,8 @@ type PartnerDocument { # A type-specific Gravity Mongo Document ID. internalID: ID! - publicUrl: String! @deprecated(reason: "Prefer `publicURL`") publicURL: String! + publicUrl: String! @deprecated(reason: "Prefer `publicURL`") size: Int! @deprecated(reason: "Prefer `filesize`") title: String! } @@ -14300,8 +13853,7 @@ type PartnerEdge { type PartnerInquiryRequest { collectorProfile: InquirerCollectorProfile - # Returns the first message of an inquiry with the addition of any inquiry - # questions submitted by the user, formatted and if present. + # Returns the first message of an inquiry with the addition of any inquiry questions submitted by the user, formatted and if present. formattedFirstMessage: String # A globally unique ID. @@ -14335,18 +13887,14 @@ type PartnerOffer { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String discountPercentage: Int endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String id: String @@ -14357,18 +13905,6 @@ type PartnerOffer { userIds: [String] } -enum PartnersAggregation { - CATEGORY - LOCATION - TOTAL -} - -# The results for one of the requested aggregations -type PartnersAggregationResults { - counts: [AggregationCount] - slice: PartnersAggregation -} - # A connection to a list of items. type PartnerShowDocumentConnection { # A list of edges. @@ -14394,6 +13930,20 @@ enum PartnerShowPartnerType { MUSEUM } +union PartnerTypes = ExternalPartner | Partner + +enum PartnersAggregation { + CATEGORY + LOCATION + TOTAL +} + +# The results for one of the requested aggregations +type PartnersAggregationResults { + counts: [AggregationCount] + slice: PartnersAggregation +} + enum PartnersSortType { CREATED_AT_ASC CREATED_AT_DESC @@ -14406,8 +13956,6 @@ enum PartnersSortType { SORTABLE_ID_DESC } -union PartnerTypes = ExternalPartner | Partner - union PaymentMethodUnion = BankAccount | CreditCard | WireTransfer enum PhoneNumberErrors { @@ -14824,20 +14372,20 @@ type Query { _unused_gravity_devices(userId: ID!): [Device!]! # Autocomplete resolvers. - _unused_gravity_match_partners( - match_type: String + _unused_gravity_matchPartners( + matchType: String page: Int = 1 size: Int = 5 term: String! - ): [DoNotUseThisPartner!] @deprecated(reason: "Use matchPartners") + ): [DoNotUseThisPartner!] # Autocomplete resolvers. - _unused_gravity_matchPartners( - matchType: String + _unused_gravity_match_partners( + match_type: String page: Int = 1 size: Int = 5 term: String! - ): [DoNotUseThisPartner!] + ): [DoNotUseThisPartner!] @deprecated(reason: "Use matchPartners") # Find a partner by ID _unused_gravity_partner(id: ID!): DoNotUseThisPartner @@ -15023,6 +14571,33 @@ type Query { id: String! ): Artist + # Find an artist series by ID + artistSeries(id: ID!): ArtistSeries + + # List all artist series, optionally filtered by artist or artwork + artistSeriesConnection( + # Returns the elements in the list that come after the specified cursor. + after: String + + # ID of the artist by which to filter results + artistID: ID + + # ID of the artwork by which to filter results + artworkID: ID + + # Returns the elements in the list that come before the specified cursor. + before: String + + # Array of IDs of artist series that should be excluded from results + excludeIDs: [ID!] + + # Returns the first _n_ elements from the list. + first: Int + + # Returns the last _n_ elements from the list. + last: Int + ): ArtistSeriesConnection + # A list of Artists artists( # @@ -15068,33 +14643,6 @@ type Query { term: String ): ArtistConnection - # Find an artist series by ID - artistSeries(id: ID!): ArtistSeries - - # List all artist series, optionally filtered by artist or artwork - artistSeriesConnection( - # Returns the elements in the list that come after the specified cursor. - after: String - - # ID of the artist by which to filter results - artistID: ID - - # ID of the artwork by which to filter results - artworkID: ID - - # Returns the elements in the list that come before the specified cursor. - before: String - - # Array of IDs of artist series that should be excluded from results - excludeIDs: [ID!] - - # Returns the first _n_ elements from the list. - first: Int - - # Returns the last _n_ elements from the list. - last: Int - ): ArtistSeriesConnection - # An Artwork artwork( # The slug or ID of the Artwork @@ -15216,11 +14764,7 @@ type Query { last: Int ): AuctionResultsByArtistsConnection - # If user is logged out; status is `LOGGED_OUT`. If user is logged in; status is - # `LOGGED_IN`. If user is logged in with invalid authentication (401); 'Promise' - # resolves to 'Status.Invalid'. All other status codes will resolve to - # `LOGGED_IN` because we don't know whether or not the authentication is valid - # (error could be something else). + # If user is logged out; status is `LOGGED_OUT`. If user is logged in; status is `LOGGED_IN`. If user is logged in with invalid authentication (401); 'Promise' resolves to 'Status.Invalid'. All other status codes will resolve to `LOGGED_IN` because we don't know whether or not the authentication is valid (error could be something else). authenticationStatus: AuthenticationStatus! # A user's bank account @@ -15381,7 +14925,7 @@ type Query { last: Int partnerId: String toBeReplied: Boolean - type: ConversationsInputMode + type: ConversationsInputMode = USER ): ConversationConnection # A user's credit card @@ -15393,9 +14937,16 @@ type Query { # A list of trending artists. Inferred from a manually curated collection of trending artworks. curatedTrendingArtists( + # Returns the items in the list that come after the specified cursor. after: String + + # Returns the items in the list that come before the specified cursor. before: String + + # Returns the first n items from the list. first: Int + + # Returns the last n items from the list. last: Int ): ArtistConnection departments: [Department!]! @@ -15595,6 +15146,9 @@ type Query { job(id: ID!): Job! jobs: [Job!]! markdown(content: String!): MarkdownContent + + # Get price insights for a market. + marketPriceInsights(artistId: ID!, medium: String!): MarketPriceInsights marketingCategories: [MarketingCollectionCategory!]! # Find a marketing collection by ID or slug @@ -15609,9 +15163,6 @@ type Query { slugs: [String!] ): [MarketingCollection!] - # Get price insights for a market. - marketPriceInsights(artistId: ID!, medium: String!): MarketPriceInsights - # A Search for Artists matchArtist( # Exclude these MongoDB ids from results @@ -15631,7 +15182,25 @@ type Query { before: String # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported - entities: [SearchEntity!] = [] + entities: [SearchEntity!] = [ + ARTIST + ARTIST_SERIES + ARTWORK + ARTICLE + CITY + COLLECTION + FAIR + FEATURE + GALLERY + GENE + INSTITUTION + PAGE + PROFILE + SALE + SHOW + TAG + VIEWING_ROOM + ] first: Int last: Int @@ -15782,6 +15351,23 @@ type Query { id: String! ): PartnerCategory + # Retrieve all partner show documents for a given partner and show + partnerShowDocumentsConnection( + after: String + before: String + first: Int + last: Int + page: Int + + # The slug or ID of the Partner + partnerID: String! + + # The slug or ID of the Show + showID: String! + size: Int + ): PartnerShowDocumentConnection + @deprecated(reason: "Prefer `partner.documentsConnection`") + # A list of Partners partnersConnection( after: String @@ -15818,23 +15404,6 @@ type Query { type: [PartnerClassification] ): PartnerConnection - # Retrieve all partner show documents for a given partner and show - partnerShowDocumentsConnection( - after: String - before: String - first: Int - last: Int - page: Int - - # The slug or ID of the Partner - partnerID: String! - - # The slug or ID of the Show - showID: String! - size: Int - ): PartnerShowDocumentConnection - @deprecated(reason: "Prefer `partner.documentsConnection`") - # Phone number information phoneNumber(phoneNumber: String!, regionCode: String): PhoneNumberType @@ -16125,9 +15694,7 @@ type Quiz { completedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -16166,9 +15733,7 @@ type QuizArtworkEdge { interactedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -16219,10 +15784,10 @@ input RecordArtworkViewInput { # Autogenerated return type of RecordArtworkView type RecordArtworkViewPayload { # Id of viewed artwork - artwork_id: String! @deprecated(reason: "Use artworkId") + artworkId: String! # Id of viewed artwork - artworkId: String! + artwork_id: String! @deprecated(reason: "Use artworkId") # A unique identifier for the client performing the mutation. clientMutationId: String @@ -16306,14 +15871,6 @@ type RequestLocation { id: ID! } -type RequestPriceEstimatedMutationFailure { - mutationError: GravityMutationError -} - -type RequestPriceEstimatedMutationSuccess { - submittedPriceEstimateParams: SubmittedPriceEstimateParams -} - input RequestPriceEstimateInput { artworkId: String! clientMutationId: String @@ -16331,6 +15888,14 @@ type RequestPriceEstimatePayload { priceEstimateParamsOrError: RequestPriceEstimateMutationType } +type RequestPriceEstimatedMutationFailure { + mutationError: GravityMutationError +} + +type RequestPriceEstimatedMutationSuccess { + submittedPriceEstimateParams: SubmittedPriceEstimateParams +} + type ResizedImageUrl { factor: Float! height: Int @@ -16416,10 +15981,10 @@ type Sale implements Node { status: SaleArtworkStatus ): ArtworkConnection associatedSale: Sale - bidder: Bidder # A bid increment policy that explains minimum bids in ranges. bidIncrements: [BidIncrement] + bidder: Bidder # Auction's buyer's premium policy. buyersPremium: [BuyersPremium] @@ -16437,33 +16002,25 @@ type Sale implements Node { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String endedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String eventEndAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String eventStartAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -16502,9 +16059,7 @@ type Sale implements Node { liveStartAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -16517,9 +16072,7 @@ type Sale implements Node { registrationEndsAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -16546,9 +16099,7 @@ type Sale implements Node { startAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String status: String @@ -16585,17 +16136,13 @@ type SaleArtwork implements ArtworkEdgeInterface & Node { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String endedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String estimate: String @@ -16605,9 +16152,7 @@ type SaleArtwork implements ArtworkEdgeInterface & Node { extendedBiddingEndAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -16616,8 +16161,8 @@ type SaleArtwork implements ArtworkEdgeInterface & Node { # A formatted description of when the lot starts or ends or if it has ended formattedStartDateTime: String - highestBid: SaleArtworkHighestBid highEstimate: SaleArtworkHighEstimate + highestBid: SaleArtworkHighestBid # A globally unique ID. id: ID! @@ -16628,16 +16173,15 @@ type SaleArtwork implements ArtworkEdgeInterface & Node { # A type-specific ID likely used as a database ID. internalID: ID! + isBidOn: Boolean # Can bids be placed on the artwork? isBiddable: Boolean - isBidOn: Boolean # Is the user the highest bidder on the sale artwork. (Currently only being used via me.myBids.) isHighestBidder: Boolean - # True if this sale artwork is being watched by a user and they have not bid on - # it. (Currently only used on me.myBids and me.watchedLotsConnection.) + # True if this sale artwork is being watched by a user and they have not bid on it. (Currently only used on me.myBids and me.watchedLotsConnection.) isWatching: Boolean isWithReserve: Boolean lotID: String @@ -16717,7 +16261,7 @@ type SaleArtworkEdge { node: SaleArtwork } -type SaleArtworkHighestBid { +type SaleArtworkHighEstimate { # A formatted price with various currency formatting options. amount( decimal: String = "." @@ -16729,20 +16273,15 @@ type SaleArtworkHighestBid { symbol: String thousand: String = "," ): String - cents: Int - createdAt( - format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones - timezone: String - ): String + # An amount of money expressed in cents. + cents: Float + + # A pre-formatted price. display: String - isCancelled: Boolean } -type SaleArtworkHighEstimate { +type SaleArtworkHighestBid { # A formatted price with various currency formatting options. amount( decimal: String = "." @@ -16754,12 +16293,15 @@ type SaleArtworkHighEstimate { symbol: String thousand: String = "," ): String + cents: Int + createdAt( + format: String - # An amount of money expressed in cents. - cents: Float - - # A pre-formatted price. + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String display: String + isCancelled: Boolean } type SaleArtworkLowEstimate { @@ -16842,6 +16384,11 @@ type SaleArtworkReserve { display: String } +enum SaleArtworkStatus { + CLOSED + OPEN +} + # The results for one of the requested aggregations type SaleArtworksAggregationResults { counts: [AggregationCount] @@ -16849,13 +16396,13 @@ type SaleArtworksAggregationResults { } # A connection to a list of items. -type SaleArtworksConnection implements ArtworkConnectionInterface { +type SaleArtworksConnection { # Returns aggregation counts for the given filter query. aggregations: [SaleArtworksAggregationResults] counts: FilterSaleArtworksCounts # A list of edges. - edges: [SaleArtwork] + edges: [SaleArtworksEdge] pageCursors: PageCursors! # Information to aid in pagination. @@ -16863,9 +16410,13 @@ type SaleArtworksConnection implements ArtworkConnectionInterface { totalCount: Int } -enum SaleArtworkStatus { - CLOSED - OPEN +# An edge in a connection. +type SaleArtworksEdge { + # A cursor for use in pagination + cursor: String! + + # The item at the end of the edge + node: Artwork } type SaleCascadingEndTime { @@ -16924,8 +16475,6 @@ type SaleRegistrationEdge { } enum SaleSorts { - _ID_ASC - _ID_DESC CREATED_AT_ASC CREATED_AT_DESC ELIGIBLE_SALE_ARTWORKS_COUNT_ASC @@ -16939,6 +16488,8 @@ enum SaleSorts { START_AT_DESC TIMELY_AT_NAME_ASC TIMELY_AT_NAME_DESC + _ID_ASC + _ID_DESC } input SaveArtworkInput { @@ -16978,14 +16529,6 @@ type SavedArtworksEdge { node: Artwork } -enum SavedSearchesSortEnum { - # Sort by created date in descending order - CREATED_AT_DESC - - # Sort by name in ascending order - NAME_ASC -} - # Saved Search User Alert Settings type SavedSearchUserAlertSettings { details: String @@ -16995,51 +16538,12 @@ type SavedSearchUserAlertSettings { push: Boolean! } -# An object that may be searched for -interface Searchable { - displayLabel: String - href: String - imageUrl: String -} - -# A connection to a list of items. -type SearchableConnection { - # Returns aggregation counts for the given filter query. - aggregations: [SearchAggregationResults] - - # A list of edges. - edges: [SearchableEdge] - pageCursors: PageCursors! - - # Information to aid in pagination. - pageInfo: PageInfo! - totalCount: Int -} - -# An edge in a connection. -type SearchableEdge { - # A cursor for use in pagination - cursor: String! - - # The item at the end of the edge - node: Searchable -} - -type SearchableItem implements Node & Searchable { - description: String - displayLabel: String - displayType: String - href: String - - # A globally unique ID. - id: ID! - imageUrl: String - - # A type-specific ID likely used as a database ID. - internalID: ID! +enum SavedSearchesSortEnum { + # Sort by created date in descending order + CREATED_AT_DESC - # A slug ID. - slug: ID! + # Sort by name in ascending order + NAME_ASC } enum SearchAggregation { @@ -17063,6 +16567,7 @@ type SearchCriteria { additionalGeneNames: [String!]! artistID: String @deprecated(reason: "Deprecated in favor of artistIDs array") artistIDs: [String!] + artistSeriesIDs: [String!]! artistsConnection( after: String before: String @@ -17072,7 +16577,6 @@ type SearchCriteria { sort: ArtistSorts term: String ): ArtistConnection - artistSeriesIDs: [String!]! atAuction: Boolean attributionClass: [String!]! colors: [String!]! @@ -17215,6 +16719,53 @@ enum SearchMode { SITE } +# An object that may be searched for +interface Searchable { + displayLabel: String + href: String + imageUrl: String +} + +# A connection to a list of items. +type SearchableConnection { + # Returns aggregation counts for the given filter query. + aggregations: [SearchAggregationResults] + + # A list of edges. + edges: [SearchableEdge] + pageCursors: PageCursors! + + # Information to aid in pagination. + pageInfo: PageInfo! + totalCount: Int +} + +# An edge in a connection. +type SearchableEdge { + # A cursor for use in pagination + cursor: String! + + # The item at the end of the edge + node: Searchable +} + +type SearchableItem implements Node & Searchable { + description: String + displayLabel: String + displayType: String + href: String + + # A globally unique ID. + id: ID! + imageUrl: String + + # A type-specific ID likely used as a database ID. + internalID: ID! + + # A slug ID. + slug: ID! +} + interface SecondFactor { createdAt: ISO8601DateTime! disabledAt: ISO8601DateTime @@ -17432,9 +16983,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -17443,9 +16992,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -17455,7 +17002,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String # If the show is in a Fair, then that fair @@ -17602,7 +17149,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { sort: ShowSorts # By default show only current shows - status: EventStatus + status: EventStatus = CURRENT ): ShowConnection # Alternate Markdown-supporting free text representation of the opening reception event’s date/time @@ -17624,9 +17171,7 @@ type Show implements EntityWithFilterArtworksConnectionInterface & Node { startAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -17697,9 +17242,7 @@ type ShowEventType { endAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String eventType: String @@ -17707,14 +17250,12 @@ type ShowEventType { # A formatted description of the start to end dates exhibitionPeriod( # Formatting option to apply to exhibition period - format: ExhibitionPeriodFormat + format: ExhibitionPeriodFormat = LONG ): String startAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String title: String @@ -17798,27 +17339,10 @@ input SmsSecondFactorAttributes { # An SMS second factor or errors union SmsSecondFactorOrErrorsUnion = Errors | SmsSecondFactor -enum sort { - ASC - DESC -} - type StartIdentityVerificationFailure { mutationError: GravityMutationError } -input startIdentityVerificationMutationInput { - clientMutationId: String - - # Primary ID of the identity verification to be started - identityVerificationId: String! -} - -type startIdentityVerificationMutationPayload { - clientMutationId: String - startIdentityVerificationResponseOrError: StartIdentityVerificationResponseOrError -} - union StartIdentityVerificationResponseOrError = StartIdentityVerificationFailure | StartIdentityVerificationSuccess @@ -17924,6 +17448,7 @@ type System { # Creates, and authorizes, a JWT custom for Causality causalityJWT( + # role: LiveAuctionRole # The id of the auction to participate in @@ -18220,10 +17745,6 @@ type UpdateArtistSuccess { artist: Artist } -type updateArtworkFailure { - mutationError: GravityMutationError -} - input UpdateArtworkMutationInput { # The availability of the artwork availability: String @@ -18239,12 +17760,6 @@ type UpdateArtworkMutationPayload { clientMutationId: String } -union updateArtworkResponseOrError = updateArtworkFailure | updateArtworkSuccess - -type updateArtworkSuccess { - artwork: Artwork -} - type UpdateCMSLastAccessTimestampFailure { mutationError: GravityMutationError } @@ -18275,19 +17790,6 @@ type UpdateCollectionFailure { mutationError: GravityMutationError } -input updateCollectionInput { - clientMutationId: String - - # The internal ID of the collection - id: String! - name: String! -} - -type updateCollectionPayload { - clientMutationId: String - responseOrError: UpdateCollectionResponseOrError -} - union UpdateCollectionResponseOrError = UpdateCollectionFailure | UpdateCollectionSuccess @@ -18321,9 +17823,7 @@ type UpdateCollectorProfilePayload { artsyUserSince( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String bio: String @@ -18337,9 +17837,7 @@ type UpdateCollectorProfilePayload { confirmedBuyerAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String email: String @@ -18370,9 +17868,7 @@ type UpdateCollectorProfilePayload { loyaltyApplicantAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String name: String @@ -18387,17 +17883,13 @@ type UpdateCollectorProfilePayload { professionalBuyerAppliedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String professionalBuyerAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String selfReportedPurchases: String @@ -18475,68 +17967,64 @@ type UpdateConversationMutationPayload { conversation: Conversation } -type UpdateFeaturedLinkFailure { +type UpdateFeatureFailure { mutationError: GravityMutationError } -input UpdateFeaturedLinkMutationInput { +input UpdateFeatureMutationInput { + active: Boolean + callout: String clientMutationId: String description: String - href: String id: String! + layout: FeatureLayouts + name: String sourceBucket: String sourceKey: String - subtitle: String - title: String + subheadline: String } -type UpdateFeaturedLinkMutationPayload { +type UpdateFeatureMutationPayload { clientMutationId: String - # On success: featured link updated. - featuredLinkOrError: UpdateFeaturedLinkResponseOrError + # On success: the feature updated. + featureOrError: UpdateFeatureResponseOrError } -union UpdateFeaturedLinkResponseOrError = - UpdateFeaturedLinkFailure - | UpdateFeaturedLinkSuccess +union UpdateFeatureResponseOrError = UpdateFeatureFailure | UpdateFeatureSuccess -type UpdateFeaturedLinkSuccess { - featuredLink: FeaturedLink +type UpdateFeatureSuccess { + feature: Feature } -type UpdateFeatureFailure { +type UpdateFeaturedLinkFailure { mutationError: GravityMutationError } -input UpdateFeatureMutationInput { - active: Boolean - callout: String +input UpdateFeaturedLinkMutationInput { clientMutationId: String description: String + href: String id: String! - layout: FeatureLayouts - name: String sourceBucket: String sourceKey: String - subheadline: String + subtitle: String + title: String } -type UpdateFeatureMutationPayload { +type UpdateFeaturedLinkMutationPayload { clientMutationId: String - # On success: the feature updated. - featureOrError: UpdateFeatureResponseOrError + # On success: featured link updated. + featuredLinkOrError: UpdateFeaturedLinkResponseOrError } -union UpdateFeatureResponseOrError = UpdateFeatureFailure | UpdateFeatureSuccess - -type UpdateFeatureSuccess { - feature: Feature -} +union UpdateFeaturedLinkResponseOrError = + UpdateFeaturedLinkFailure + | UpdateFeaturedLinkSuccess -type updateHeroUnitFailure { - mutationError: GravityMutationError +type UpdateFeaturedLinkSuccess { + featuredLink: FeaturedLink } input UpdateHeroUnitLinkInput { @@ -18565,14 +18053,6 @@ type UpdateHeroUnitMutationPayload { heroUnitOrError: updateHeroUnitResponseOrError } -union updateHeroUnitResponseOrError = - updateHeroUnitFailure - | updateHeroUnitSuccess - -type updateHeroUnitSuccess { - heroUnit: HeroUnit -} - type UpdateMessageFailure { mutationError: GravityMutationError } @@ -18738,21 +18218,6 @@ type UpdateMyProfilePayload { userOrError: UpdateMyProfileMutation } -input updateNotificationPreferencesMutationInput { - authenticationToken: String - clientMutationId: String - subscriptionGroups: [NotificationPreferenceInput!]! -} - -type updateNotificationPreferencesMutationPayload { - clientMutationId: String - - # User's notification preferences - notificationPreferences( - authenticationToken: String - ): [NotificationPreference!]! -} - type UpdateOrderedSetFailure { mutationError: GravityMutationError } @@ -18817,18 +18282,6 @@ type UpdatePageSuccess { page: Page } -input updateQuizMutationInput { - artworkId: String! - clearInteraction: Boolean - clientMutationId: String - userId: String! -} - -type updateQuizMutationPayload { - clientMutationId: String - quiz: Quiz -} - # Autogenerated input type of UpdateSavedSearch input UpdateSavedSearchInput { attributes: SearchCriteriaAttributes @@ -18973,6 +18426,10 @@ union UpdateUserInterestResponseOrError = UpdateUserInterestFailure | UpdateUserInterestSuccess +type UpdateUserInterestSuccess { + userInterest: UserInterest +} + type UpdateUserInterestsFailure { mutationError: GravityMutationError } @@ -18988,10 +18445,6 @@ type UpdateUserInterestsMutationPayload { userInterestsOrErrors: [UpdateUserInterestOrError!]! } -type UpdateUserInterestSuccess { - userInterest: UserInterest -} - input UpdateUserMutationInput { clientMutationId: String dataTransferOptOut: Boolean @@ -19090,9 +18543,7 @@ type User implements Node { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -19105,17 +18556,13 @@ type User implements Node { emailConfirmationSentAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String emailConfirmedAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String follows: UserFollows @@ -19144,9 +18591,7 @@ type User implements Node { lastSignInAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -19382,9 +18827,7 @@ type UserAdminNotes { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -19471,9 +18914,7 @@ type UserInquiredArtworksEdge { createdAt( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String @@ -19601,9 +19042,7 @@ type UserPurchasesEdge { saleDate( format: String - # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See - # http://www.iana.org/time-zones, - # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String salePrice: Float @@ -19976,11 +19415,7 @@ type Viewer { id: String! ): AuctionResult - # If user is logged out; status is `LOGGED_OUT`. If user is logged in; status is - # `LOGGED_IN`. If user is logged in with invalid authentication (401); 'Promise' - # resolves to 'Status.Invalid'. All other status codes will resolve to - # `LOGGED_IN` because we don't know whether or not the authentication is valid - # (error could be something else). + # If user is logged out; status is `LOGGED_OUT`. If user is logged in; status is `LOGGED_IN`. If user is logged in with invalid authentication (401); 'Promise' resolves to 'Status.Invalid'. All other status codes will resolve to `LOGGED_IN` because we don't know whether or not the authentication is valid (error could be something else). authenticationStatus: AuthenticationStatus! # A user's bank account @@ -20036,7 +19471,7 @@ type Viewer { last: Int partnerId: String toBeReplied: Boolean - type: ConversationsInputMode + type: ConversationsInputMode = USER ): ConversationConnection # A user's credit card @@ -20047,9 +19482,16 @@ type Viewer { # A list of trending artists. Inferred from a manually curated collection of trending artworks. curatedTrendingArtists( + # Returns the items in the list that come after the specified cursor. after: String + + # Returns the items in the list that come before the specified cursor. before: String + + # Returns the first n items from the list. first: Int + + # Returns the last n items from the list. last: Int ): ArtistConnection departments: [Department!]! @@ -20276,7 +19718,25 @@ type Viewer { before: String # ARTIST_SERIES, CITY, COLLECTION, and VIEWING_ROOM are not yet supported - entities: [SearchEntity!] = [] + entities: [SearchEntity!] = [ + ARTIST + ARTIST_SERIES + ARTWORK + ARTICLE + CITY + COLLECTION + FAIR + FEATURE + GALLERY + GENE + INSTITUTION + PAGE + PROFILE + SALE + SHOW + TAG + VIEWING_ROOM + ] first: Int last: Int @@ -20396,6 +19856,23 @@ type Viewer { id: String! ): PartnerCategory + # Retrieve all partner show documents for a given partner and show + partnerShowDocumentsConnection( + after: String + before: String + first: Int + last: Int + page: Int + + # The slug or ID of the Partner + partnerID: String! + + # The slug or ID of the Show + showID: String! + size: Int + ): PartnerShowDocumentConnection + @deprecated(reason: "Prefer `partner.documentsConnection`") + # A list of Partners partnersConnection( after: String @@ -20432,23 +19909,6 @@ type Viewer { type: [PartnerClassification] ): PartnerConnection - # Retrieve all partner show documents for a given partner and show - partnerShowDocumentsConnection( - after: String - before: String - first: Int - last: Int - page: Int - - # The slug or ID of the Partner - partnerID: String! - - # The slug or ID of the Show - showID: String! - size: Int - ): PartnerShowDocumentConnection - @deprecated(reason: "Prefer `partner.documentsConnection`") - # Phone number information phoneNumber(phoneNumber: String!, regionCode: String): PhoneNumberType @@ -20791,30 +20251,6 @@ type ViewingRoomPublishedNotificationItem { ): ViewingRoomsConnection } -# The connection type for ViewingRoom. -type ViewingRoomsConnection { - # A list of edges. - edges: [ViewingRoomsEdge] - - # A list of nodes. - nodes: [ViewingRoom] - pageCursors: PageCursors - - # Information to aid in pagination. - pageInfo: PageInfo! - totalCount: Int - totalPages: Int -} - -# An edge in a connection. -type ViewingRoomsEdge { - # A cursor for use in pagination. - cursor: String! - - # The item at the end of the edge. - node: ViewingRoom -} - enum ViewingRoomStatusEnum { closed draft @@ -20858,6 +20294,30 @@ input ViewingRoomSubsectionInput { internalID: ID } +# The connection type for ViewingRoom. +type ViewingRoomsConnection { + # A list of edges. + edges: [ViewingRoomsEdge] + + # A list of nodes. + nodes: [ViewingRoom] + pageCursors: PageCursors + + # Information to aid in pagination. + pageInfo: PageInfo! + totalCount: Int + totalPages: Int +} + +# An edge in a connection. +type ViewingRoomsEdge { + # A cursor for use in pagination. + cursor: String! + + # The item at the end of the edge. + node: ViewingRoom +} + enum Visibility { LISTED UNLISTED @@ -20874,3 +20334,409 @@ type YearRange { # The first year of the year range startAt: Int } + +type addOrderedSetItemFailure { + mutationError: GravityMutationError +} + +input addOrderedSetItemMutationInput { + clientMutationId: String + geminiToken: String + id: String! + itemId: String! + position: Int +} + +type addOrderedSetItemMutationPayload { + # On success: the updated parent set or the set item added. + addOrderedSetItemResponseOrError: addOrderedSetItemResponseOrError + clientMutationId: String +} + +union addOrderedSetItemResponseOrError = + addOrderedSetItemFailure + | addOrderedSetItemSuccess + +type addOrderedSetItemSuccess { + set: OrderedSet + setItem: OrderedSetItem +} + +type addUserRoleFailure { + mutationError: GravityMutationError +} + +input addUserRoleMutationInput { + clientMutationId: String + id: String! + role_type: String! +} + +type addUserRoleMutationPayload { + clientMutationId: String + + # On success: the user + userOrError: addUserRoleResponseOrError +} + +union addUserRoleResponseOrError = addUserRoleFailure | addUserRoleSuccess + +type addUserRoleSuccess { + user: User +} + +type createAdvisoryOpportunityFailure { + mutationError: GravityMutationError +} + +input createAdvisoryOpportunityMutationInput { + clientMutationId: String + message: String + phoneCountryCode: String + phoneNumber: String + searchCriteriaID: String! +} + +type createAdvisoryOpportunityMutationPayload { + # On success: the advisory opportunity + advisoryOpportunityOrError: createAdvisoryOpportunityResponseOrError + clientMutationId: String +} + +union createAdvisoryOpportunityResponseOrError = + createAdvisoryOpportunityFailure + | createAdvisoryOpportunitySuccess + +type createAdvisoryOpportunitySuccess { + advisoryOpportunity: AdvisoryOpportunity! +} + +input createCollectionInput { + clientMutationId: String + name: String! +} + +type createCollectionPayload { + clientMutationId: String + responseOrError: CreateCollectionResponseOrError +} + +union createFeatureResponseOrError = CreateFeatureFailure | CreateFeatureSuccess + +type createHeroUnitFailure { + mutationError: GravityMutationError +} + +union createHeroUnitResponseOrError = + createHeroUnitFailure + | createHeroUnitSuccess + +type createHeroUnitSuccess { + heroUnit: HeroUnit +} + +type createOrderedSetFailure { + mutationError: GravityMutationError +} + +union createOrderedSetResponseOrError = + createOrderedSetFailure + | createOrderedSetSuccess + +type createOrderedSetSuccess { + set: OrderedSet +} + +type createPartnerOfferFailure { + mutationError: GravityMutationError +} + +input createPartnerOfferMutationInput { + artwork_id: String! + clientMutationId: String + discount_percentage: Int +} + +type createPartnerOfferMutationPayload { + clientMutationId: String + + # On success: the partner offer created. + partnerOfferOrError: createPartnerOfferResponseOrError +} + +union createPartnerOfferResponseOrError = + createPartnerOfferFailure + | createPartnerOfferSuccess + +type createPartnerOfferSuccess { + partnerOffer: PartnerOffer +} + +type createUserAdminNoteFailure { + mutationError: GravityMutationError +} + +input createUserAdminNoteMutationInput { + body: String! + clientMutationId: String + id: String! +} + +type createUserAdminNoteMutationPayload { + # On success: the admin note created. + adminNoteOrError: createUserAdminNoteResponseOrError + clientMutationId: String +} + +union createUserAdminNoteResponseOrError = + createUserAdminNoteFailure + | createUserAdminNoteSuccess + +type createUserAdminNoteSuccess { + adminNote: UserAdminNotes +} + +type createUserInterestForUserFailure { + mutationError: GravityMutationError +} + +union createUserInterestForUserResponseOrError = + createUserInterestForUserFailure + | createUserInterestForUserSuccess + +type createUserInterestForUserSuccess { + user: User + userInterest: UserInterest +} + +input deleteCollectionInput { + clientMutationId: String + id: String! +} + +type deleteCollectionPayload { + clientMutationId: String + + # On success: the deleted collection + responseOrError: DeleteCollectionResponseOrError +} + +type deleteHeroUnitFailure { + mutationError: GravityMutationError +} + +input deleteHeroUnitMutationInput { + clientMutationId: String + id: String! +} + +type deleteHeroUnitMutationPayload { + clientMutationId: String + + # On success: the deleted hero unit. + heroUnitOrError: deleteHeroUnitResponseOrError +} + +union deleteHeroUnitResponseOrError = + deleteHeroUnitFailure + | deleteHeroUnitSuccess + +type deleteHeroUnitSuccess { + heroUnit: HeroUnit +} + +type deleteOrderedSetFailure { + mutationError: GravityMutationError +} + +type deleteOrderedSetItemFailure { + mutationError: GravityMutationError +} + +input deleteOrderedSetItemMutationInput { + clientMutationId: String + id: String! + itemId: String! +} + +type deleteOrderedSetItemMutationPayload { + clientMutationId: String + + # On success: the updated parent set or the set item deleted. + deleteOrderedSetItemResponseOrError: deleteOrderedSetItemResponseOrError +} + +union deleteOrderedSetItemResponseOrError = + deleteOrderedSetItemFailure + | deleteOrderedSetItemSuccess + +type deleteOrderedSetItemSuccess { + set: OrderedSet + setItem: OrderedSetItem +} + +input deleteOrderedSetMutationInput { + clientMutationId: String + id: String! +} + +type deleteOrderedSetMutationPayload { + clientMutationId: String + + # On success: the deleted ordered set. + orderedSetOrError: deleteOrderedSetResponseOrError +} + +union deleteOrderedSetResponseOrError = + deleteOrderedSetFailure + | deleteOrderedSetSuccess + +type deleteOrderedSetSuccess { + set: OrderedSet +} + +type deleteUserAdminNoteFailure { + mutationError: GravityMutationError +} + +input deleteUserAdminNoteMutationInput { + adminNoteId: String! + clientMutationId: String + id: String! +} + +type deleteUserAdminNoteMutationPayload { + # On success: the admin note deleted. + adminNoteOrError: deleteUserAdminNoteResponseOrError + clientMutationId: String +} + +union deleteUserAdminNoteResponseOrError = + deleteUserAdminNoteFailure + | deleteUserAdminNoteSuccess + +type deleteUserAdminNoteSuccess { + adminNote: UserAdminNotes +} + +type deleteUserInterestForUserFailure { + mutationError: GravityMutationError +} + +union deleteUserInterestForUserResponseOrError = + deleteUserInterestForUserFailure + | deleteUserInterestForUserSuccess + +type deleteUserInterestForUserSuccess { + user: User + userInterest: UserInterest +} + +type deleteUserRoleFailure { + mutationError: GravityMutationError +} + +input deleteUserRoleMutationInput { + clientMutationId: String + id: String! + role_type: String! +} + +type deleteUserRoleMutationPayload { + clientMutationId: String + + # On success: the user. + userOrError: deleteUserRoleResponseOrError +} + +union deleteUserRoleResponseOrError = + deleteUserRoleFailure + | deleteUserRoleSuccess + +type deleteUserRoleSuccess { + user: User +} + +type dimensions { + cm: String + in: String +} + +enum sort { + ASC + DESC +} + +input startIdentityVerificationMutationInput { + clientMutationId: String + + # Primary ID of the identity verification to be started + identityVerificationId: String! +} + +type startIdentityVerificationMutationPayload { + clientMutationId: String + startIdentityVerificationResponseOrError: StartIdentityVerificationResponseOrError +} + +type updateArtworkFailure { + mutationError: GravityMutationError +} + +union updateArtworkResponseOrError = updateArtworkFailure | updateArtworkSuccess + +type updateArtworkSuccess { + artwork: Artwork +} + +input updateCollectionInput { + clientMutationId: String + + # The internal ID of the collection + id: String! + name: String! +} + +type updateCollectionPayload { + clientMutationId: String + responseOrError: UpdateCollectionResponseOrError +} + +type updateHeroUnitFailure { + mutationError: GravityMutationError +} + +union updateHeroUnitResponseOrError = + updateHeroUnitFailure + | updateHeroUnitSuccess + +type updateHeroUnitSuccess { + heroUnit: HeroUnit +} + +input updateNotificationPreferencesMutationInput { + authenticationToken: String + clientMutationId: String + subscriptionGroups: [NotificationPreferenceInput!]! +} + +type updateNotificationPreferencesMutationPayload { + clientMutationId: String + + # User's notification preferences + notificationPreferences( + authenticationToken: String + ): [NotificationPreference!]! +} + +input updateQuizMutationInput { + artworkId: String! + clearInteraction: Boolean + clientMutationId: String + userId: String! +} + +type updateQuizMutationPayload { + clientMutationId: String + quiz: Quiz +} diff --git a/src/schema/v2/sale_artworks.ts b/src/schema/v2/sale_artworks.ts index 047644d9fd..9a3776630f 100644 --- a/src/schema/v2/sale_artworks.ts +++ b/src/schema/v2/sale_artworks.ts @@ -2,25 +2,24 @@ import { GraphQLBoolean, GraphQLFieldConfig, GraphQLID, + GraphQLInt, GraphQLList, GraphQLObjectType, GraphQLString, - GraphQLInt, } from "graphql" import { connectionFromArraySlice } from "graphql-relay" import { convertConnectionArgsToGravityArgs } from "lib/helpers" import { map, omit } from "lodash" import { pageable } from "relay-cursor-paging" -import numeral from "./fields/numeral" +import { connectionWithCursorInfo } from "schema/v2/fields/pagination" import { ResolverContext } from "types/graphql" -import { SaleArtworkType } from "./sale_artwork" import { SaleArtworksAggregation, SaleArtworksAggregationResultsType, } from "./aggregations/filter_sale_artworks_aggregation" -import { ArtworkType, ArtworkConnectionInterface } from "./artwork" -import { connectionWithCursorInfo } from "schema/v2/fields/pagination" +import { ArtworkType } from "./artwork" +import numeral from "./fields/numeral" const DEFAULTS = { aggregations: ["total"], @@ -58,12 +57,10 @@ const SaleArtworkCounts = { export const SaleArtworksConnectionType = connectionWithCursorInfo({ name: "SaleArtworks", nodeType: ArtworkType, - edgeType: SaleArtworkType, connectionFields: { aggregations: SaleArtworkAggregations, counts: SaleArtworkCounts, }, - connectionInterfaces: [ArtworkConnectionInterface], }).connectionType export const SaleArtworksConnectionField: GraphQLFieldConfig< From c9d0e8289797da128b9e69b77b7c96dd16fa383c Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 14:28:23 +0100 Subject: [PATCH 20/26] chore: remove unnecessary patch --- patches/graphql-tools+4.0.8.patch | 137 ------------------------------ 1 file changed, 137 deletions(-) delete mode 100644 patches/graphql-tools+4.0.8.patch diff --git a/patches/graphql-tools+4.0.8.patch b/patches/graphql-tools+4.0.8.patch deleted file mode 100644 index d3bfccd6cf..0000000000 --- a/patches/graphql-tools+4.0.8.patch +++ /dev/null @@ -1,137 +0,0 @@ -diff --git a/node_modules/graphql-tools/dist/stitching/resolvers.js b/node_modules/graphql-tools/dist/stitching/resolvers.js -index 5c18b05..1aaa8af 100644 ---- a/node_modules/graphql-tools/dist/stitching/resolvers.js -+++ b/node_modules/graphql-tools/dist/stitching/resolvers.js -@@ -51,7 +51,9 @@ function createProxyingResolver(schema, operation, fieldName, transforms) { - schema: schema, - operation: operation, - fieldName: fieldName, -- args: {}, -+ // It is unclear if passing on `args` here is without downsides or this -+ // _has_ to be `{}`. -+ args: args, - context: context, - info: info, - transforms: transforms, -diff --git a/node_modules/graphql-tools/dist/stitching/schemaRecreation.js b/node_modules/graphql-tools/dist/stitching/schemaRecreation.js -index b2bdfdc..07ac440 100644 ---- a/node_modules/graphql-tools/dist/stitching/schemaRecreation.js -+++ b/node_modules/graphql-tools/dist/stitching/schemaRecreation.js -@@ -62,7 +62,9 @@ function recreateType(type, resolveType, keepResolvers) { - var newValues_1 = {}; - values.forEach(function (value) { - newValues_1[value.name] = { -- value: value.value, -+ // Simply pass-through the name of the enum entry such that the enum type in the original schema will -+ // receive that and will be able to do its work as if it were never proxied. -+ value: value.name, - deprecationReason: value.deprecationReason, - description: value.description, - astNode: value.astNode, -diff --git a/node_modules/graphql-tools/dist/transforms/FilterTypes.js b/node_modules/graphql-tools/dist/transforms/FilterTypes.js -index c947a4d..73cd984 100644 ---- a/node_modules/graphql-tools/dist/transforms/FilterTypes.js -+++ b/node_modules/graphql-tools/dist/transforms/FilterTypes.js -@@ -1,6 +1,9 @@ - /* tslint:disable:no-unused-expression */ - Object.defineProperty(exports, "__esModule", { value: true }); - var visitSchema_1 = require("../transforms/visitSchema"); -+var graphql_1 = require("graphql"); -+var schemaRecreation_1 = require("../stitching/schemaRecreation"); -+ - var FilterTypes = /** @class */ (function () { - function FilterTypes(filter) { - this.filter = filter; -@@ -8,15 +11,43 @@ var FilterTypes = /** @class */ (function () { - FilterTypes.prototype.transformSchema = function (schema) { - var _a; - var _this = this; -+ var filteredTypes = []; -+ var resolveType = schemaRecreation_1.createResolveType((_name, type) => type); - return visitSchema_1.visitSchema(schema, (_a = {}, - _a[visitSchema_1.VisitSchemaKind.TYPE] = function (type) { - if (_this.filter(type)) { - return undefined; - } - else { -+ filteredTypes.push(type); - return null; - } - }, -+ _a[visitSchema_1.VisitSchemaKind.UNION_TYPE] = function (type) { -+ const memberTypes = type.getTypes(); -+ const filteredMemberTypes = filteredTypes.filter(t => memberTypes.includes(t)); -+ if (filteredMemberTypes.length > 0) { -+ const remainingMemberTypes = memberTypes.filter(t => !filteredMemberTypes.includes(t)); -+ if (remainingMemberTypes.length === 0) { -+ // Remove the union entirely if it has no members anymore -+ return null; -+ } else { -+ // Return a new union with the remaining members -+ return new graphql_1.GraphQLUnionType({ -+ name: type.name, -+ description: type.description, -+ astNode: type.astNode, -+ types: remainingMemberTypes.map(function (memberType) { -+ return resolveType(memberType); -+ }), -+ resolveType: type.resolveType -+ }); -+ } -+ } -+ else { -+ return undefined; -+ } -+ }, - _a)); - }; - return FilterTypes; -diff --git a/node_modules/graphql-tools/dist/transforms/visitSchema.js b/node_modules/graphql-tools/dist/transforms/visitSchema.js -index b36f093..0cefb6a 100644 ---- a/node_modules/graphql-tools/dist/transforms/visitSchema.js -+++ b/node_modules/graphql-tools/dist/transforms/visitSchema.js -@@ -36,7 +36,35 @@ function visitSchema(schema, visitor, stripResolvers) { - var mutationType = schema.getMutationType(); - var subscriptionType = schema.getSubscriptionType(); - var typeMap = schema.getTypeMap(); -- Object.keys(typeMap).map(function (typeName) { -+ var directives = []; -+ schema.getDirectives().forEach(directive => { -+ directives.push(directive) -+ }) -+ -+ // Move interfaces to the front of the list, as the call-site may need to -+ // transform both interface and object types and thus need to be able to -+ // refer to the transformed interface types when creating the transformed -+ // object types. -+ // -+ // Move union types to the end of the list, as we may need to adjust the -+ // members list based on types previously filtered from the schema. -+ var typeKeys = Object.keys(typeMap).sort(function (typeNameA, typeNameB) { -+ const typeA = typeMap[typeNameA]; -+ const typeB = typeMap[typeNameB]; -+ if (typeA instanceof graphql_1.GraphQLInterfaceType) { -+ return -1; -+ } else if (typeB instanceof graphql_1.GraphQLInterfaceType) { -+ return 1; -+ } -+ if (typeA instanceof graphql_1.GraphQLUnionType) { -+ return 1; -+ } else if (typeB instanceof graphql_1.GraphQLUnionType) { -+ return -1; -+ } -+ return 0; -+ }); -+ -+ typeKeys.map(function (typeName) { - var type = typeMap[typeName]; - if (graphql_1.isNamedType(type) && graphql_1.getNamedType(type).name.slice(0, 2) !== '__') { - var specifiers = getTypeSpecifiers(type, schema); -@@ -67,6 +95,7 @@ function visitSchema(schema, visitor, stripResolvers) { - ? types[subscriptionType.name] - : null, - types: Object.keys(types).map(function (name) { return types[name]; }), -+ directives: directives.map((directive) => schemaRecreation_1.recreateDirective(directive, resolveType)) - }); - } - exports.visitSchema = visitSchema; From 8fd44f5ba16ece434ae86562fdcc5bc6e2a63fec Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 15:14:04 +0100 Subject: [PATCH 21/26] chore: remove graphql types patch --- patches/@types/graphql+0.13.4.patch | 52 ----------------------------- 1 file changed, 52 deletions(-) delete mode 100644 patches/@types/graphql+0.13.4.patch diff --git a/patches/@types/graphql+0.13.4.patch b/patches/@types/graphql+0.13.4.patch deleted file mode 100644 index 6bf1143f47..0000000000 --- a/patches/@types/graphql+0.13.4.patch +++ /dev/null @@ -1,52 +0,0 @@ -patch-package ---- a/node_modules/@types/graphql/type/definition.d.ts -+++ b/node_modules/@types/graphql/type/definition.d.ts -@@ -319,15 +319,15 @@ export interface GraphQLScalarTypeConfig { - * }); - * - */ --export class GraphQLObjectType { -+export class GraphQLObjectType { - name: string; - description: Maybe; - astNode: Maybe; - extensionASTNodes: Maybe>; -- isTypeOf: Maybe>; -+ isTypeOf: Maybe>; - -- constructor(config: GraphQLObjectTypeConfig); -- getFields(): GraphQLFieldMap; -+ constructor(config: GraphQLObjectTypeConfig); -+ getFields(): GraphQLFieldMap; - getInterfaces(): GraphQLInterfaceType[]; - toString(): string; - toJSON(): string; -@@ -371,7 +371,9 @@ export interface GraphQLResolveInfo { - readonly path: ResponsePath; - readonly schema: GraphQLSchema; - readonly fragments: { [key: string]: FragmentDefinitionNode }; -- readonly rootValue: any; -+ // This is re-typed as `void` to ensure nobody at Artsy uses the old pattern -+ // anymore before we moved to using the proper `context` parameter. -+ readonly rootValue: void; - readonly operation: OperationDefinitionNode; - readonly variableValues: { [variableName: string]: any }; - } -@@ -499,13 +501,14 @@ export interface GraphQLInterfaceTypeConfig { - * }); - * - */ --export class GraphQLUnionType { -+// TODO: Remove `any` defaults before submitting upstream. -+export class GraphQLUnionType { - name: string; - description: Maybe; - astNode?: Maybe; -- resolveType: Maybe>; -+ resolveType: Maybe>; - -- constructor(config: GraphQLUnionTypeConfig); -+ constructor(config: GraphQLUnionTypeConfig); - - getTypes(): GraphQLObjectType[]; - From 0841bf4968bab6d5eeffcd85a2230b018ad01b70 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 15:31:36 +0100 Subject: [PATCH 22/26] fix: properly transform CommerceDate --- _schemaV2.graphql | 7 ++++++- .../__tests__/replaceComerceDateTime.test.ts | 17 +++++++++++++---- .../transformers/replaceCommerceDateTimeType.ts | 8 ++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 381852a16f..043039b416 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -4582,7 +4582,12 @@ type CommerceFulfillment { # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones timezone: String ): String! - estimatedDelivery: CommerceDate + estimatedDelivery( + format: String + + # A tz database time zone, otherwise falls back to "X-TIMEZONE" header. See http://www.iana.org/time-zones, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + timezone: String + ): String id: ID! internalID: ID! notes: String diff --git a/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts b/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts index 743e969f2c..1159c2f9fc 100644 --- a/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts +++ b/src/lib/stitching/exchange/__tests__/replaceComerceDateTime.test.ts @@ -16,12 +16,18 @@ const originalSchema = new GraphQLSchema({ type: new GraphQLObjectType({ name: "SomeType", fields: { - someDateField: { + someCommerceDateTimeField: { type: new GraphQLScalarType({ name: "CommerceDateTime", serialize: (x) => x, }), }, + someCommerceDateField: { + type: new GraphQLScalarType({ + name: "CommerceDate", + serialize: (x) => x, + }), + }, }, }), }, @@ -41,20 +47,23 @@ describe("ReplaceCommerceDateTimeType", () => { source: gql` query { someRootField { - someDateField(format: "[The year is] YYYY") + someCommerceDateTimeField(format: "[The year is] YYYY") + someCommerceDateField(format: "[The year is] YYYY") } } `, rootValue: { someRootField: { - someDateField: "2019-07-16T19:39:10.001Z", + someCommerceDateTimeField: "2019-07-16T19:39:10.001Z", + someCommerceDateField: "2020-09-16T19:39:10.001Z", }, }, contextValue: {}, }) expect(data).toEqual({ someRootField: { - someDateField: "The year is 2019", + someCommerceDateTimeField: "The year is 2019", + someCommerceDateField: "The year is 2020", }, }) }) diff --git a/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts b/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts index 63f57e179f..94da47d6f6 100644 --- a/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts +++ b/src/lib/stitching/exchange/transformers/replaceCommerceDateTimeType.ts @@ -9,7 +9,9 @@ export const ReplaceCommerceDateTimeType = ( ) => { let newFieldConfig = fieldToConfig(fieldConfig) - if (fieldConfig.type.toString() === "CommerceDateTime!") { + if ( + ["CommerceDateTime!", "CommerceDate!"].includes(fieldConfig.type.toString()) + ) { newFieldConfig = { ...newFieldConfig, ...dateField, @@ -18,7 +20,9 @@ export const ReplaceCommerceDateTimeType = ( return newFieldConfig } - if (fieldConfig.type.toString() === "CommerceDateTime") { + if ( + ["CommerceDateTime", "CommerceDate"].includes(fieldConfig.type.toString()) + ) { newFieldConfig = { ...newFieldConfig, ...dateField, From 27602ecef07e50ecd40fdb11183bf6d477b8719f Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 15:38:35 +0100 Subject: [PATCH 23/26] fix: wrongly updated sale artwork edge type --- _schemaV2.graphql | 13 ++----------- src/schema/v2/sale_artworks.ts | 5 ++++- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/_schemaV2.graphql b/_schemaV2.graphql index 043039b416..a0f9b97072 100644 --- a/_schemaV2.graphql +++ b/_schemaV2.graphql @@ -16401,13 +16401,13 @@ type SaleArtworksAggregationResults { } # A connection to a list of items. -type SaleArtworksConnection { +type SaleArtworksConnection implements ArtworkConnectionInterface { # Returns aggregation counts for the given filter query. aggregations: [SaleArtworksAggregationResults] counts: FilterSaleArtworksCounts # A list of edges. - edges: [SaleArtworksEdge] + edges: [SaleArtwork] pageCursors: PageCursors! # Information to aid in pagination. @@ -16415,15 +16415,6 @@ type SaleArtworksConnection { totalCount: Int } -# An edge in a connection. -type SaleArtworksEdge { - # A cursor for use in pagination - cursor: String! - - # The item at the end of the edge - node: Artwork -} - type SaleCascadingEndTime { # A more granular formatted description of when the auction starts or ends if it has ended formattedStartDateTime: String diff --git a/src/schema/v2/sale_artworks.ts b/src/schema/v2/sale_artworks.ts index 9a3776630f..d5e2277611 100644 --- a/src/schema/v2/sale_artworks.ts +++ b/src/schema/v2/sale_artworks.ts @@ -18,8 +18,9 @@ import { SaleArtworksAggregation, SaleArtworksAggregationResultsType, } from "./aggregations/filter_sale_artworks_aggregation" -import { ArtworkType } from "./artwork" +import { ArtworkConnectionInterface, ArtworkType } from "./artwork" import numeral from "./fields/numeral" +import { SaleArtworkType } from "./sale_artwork" const DEFAULTS = { aggregations: ["total"], @@ -57,10 +58,12 @@ const SaleArtworkCounts = { export const SaleArtworksConnectionType = connectionWithCursorInfo({ name: "SaleArtworks", nodeType: ArtworkType, + edgeType: SaleArtworkType, connectionFields: { aggregations: SaleArtworkAggregations, counts: SaleArtworkCounts, }, + connectionInterfaces: [ArtworkConnectionInterface], }).connectionType export const SaleArtworksConnectionField: GraphQLFieldConfig< From 4d7cc0ac2764ea612d6f1fd57ad94a4dd15a40a3 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 16:03:45 +0100 Subject: [PATCH 24/26] fix: broken tests --- src/lib/__tests__/helpers.test.ts | 6 +++--- src/lib/helpers.ts | 6 +++++- .../v2/me/__tests__/followed_shows.test.ts | 2 +- src/schema/v2/search/SearchResolver.ts | 20 ++++++++++--------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/lib/__tests__/helpers.test.ts b/src/lib/__tests__/helpers.test.ts index 98b573de3f..e539e2834f 100644 --- a/src/lib/__tests__/helpers.test.ts +++ b/src/lib/__tests__/helpers.test.ts @@ -4,7 +4,7 @@ import { isExisty, isInteger, markdownToText, - removeEmptyValues, + removeObjectEmptyValues, removeNulls, resolveBlueGreen, snakeCaseKeys, @@ -200,7 +200,7 @@ describe("removeNulls", () => { }) }) -describe("removeEmptyValues", () => { +describe("removeObjectEmptyValues", () => { const obj = { a: "percy", b: null, @@ -210,7 +210,7 @@ describe("removeEmptyValues", () => { } it("removes null and undefined properties from an object", () => { - removeEmptyValues(obj) + removeObjectEmptyValues(obj) expect(obj).toHaveProperty("a", "percy") expect(obj).toHaveProperty("e", ["cat"]) expect(obj).not.toHaveProperty("b") diff --git a/src/lib/helpers.ts b/src/lib/helpers.ts index 41842df0b6..14cce18076 100644 --- a/src/lib/helpers.ts +++ b/src/lib/helpers.ts @@ -182,7 +182,7 @@ export const removeNulls = (object) => { ) // eslint-disable-line eqeqeq, no-param-reassign, max-len } -export const removeEmptyValues = (object) => { +export const removeObjectEmptyValues = (object) => { Object.keys(object).forEach( (key) => (object[key] == null || @@ -191,6 +191,10 @@ export const removeEmptyValues = (object) => { ) // eslint-disable-line eqeqeq, no-param-reassign, max-len } +export const removeArrayEmptyValues = (array) => { + return array.filter((item) => !isEmpty(item)) +} + export const resolveBlueGreen = ( resolveBlue: string, resolveGreen?: string, diff --git a/src/schema/v2/me/__tests__/followed_shows.test.ts b/src/schema/v2/me/__tests__/followed_shows.test.ts index 63f27c44c6..54c262b7fa 100644 --- a/src/schema/v2/me/__tests__/followed_shows.test.ts +++ b/src/schema/v2/me/__tests__/followed_shows.test.ts @@ -63,7 +63,7 @@ describe("returns followed shows for a user", () => { await expect( runAuthenticatedQuery(query, { followedShowsLoader }) ).rejects.toMatchInlineSnapshot( - `[GraphQLError: Expected type EventStatus, found RANDOM_INVALID_STATUS.]` + `[GraphQLError: Value "RANDOM_INVALID_STATUS" does not exist in "EventStatus" enum.]` ) } diff --git a/src/schema/v2/search/SearchResolver.ts b/src/schema/v2/search/SearchResolver.ts index 1346c8b680..d6de3d0d50 100644 --- a/src/schema/v2/search/SearchResolver.ts +++ b/src/schema/v2/search/SearchResolver.ts @@ -1,10 +1,13 @@ -import { convertConnectionArgsToGravityArgs, removeNulls } from "lib/helpers" -import { createPageCursors, pageToCursor } from "schema/v2/fields/pagination" -import { connectionFromArraySlice } from "graphql-relay" import { GraphQLResolveInfo, visit } from "graphql" -import { ResolverContext } from "types/graphql" -import { Searchable } from "schema/v2/searchable" +import { connectionFromArraySlice } from "graphql-relay" +import { + convertConnectionArgsToGravityArgs, + removeArrayEmptyValues, +} from "lib/helpers" import { SearchableItem } from "schema/v2/SearchableItem" +import { createPageCursors, pageToCursor } from "schema/v2/fields/pagination" +import { Searchable } from "schema/v2/searchable" +import { ResolverContext } from "types/graphql" export class SearchResolver { private args: { [argName: string]: any } @@ -129,11 +132,10 @@ export class SearchResolver { this.processSearchResultItem(searchResultItem) ) ).then((processedSearchResults) => { - // Filter out nulls due to a search result item being returned, - // but the item not being found. - removeNulls(processedSearchResults) const connection = connectionFromArraySlice( - processedSearchResults, + // Filter out nulls due to a search result item being returned, + // but the item not being found. + removeArrayEmptyValues(processedSearchResults), this.args, { arrayLength: totalCount, From 0f246cb0d1940e816172d12c6e3b5e899aa42628 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 1 Dec 2023 16:16:13 +0100 Subject: [PATCH 25/26] fix: broken ts --- patches/graphql-relay+0.7.0.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/graphql-relay+0.7.0.patch b/patches/graphql-relay+0.7.0.patch index dbab23f914..9d81b67090 100644 --- a/patches/graphql-relay+0.7.0.patch +++ b/patches/graphql-relay+0.7.0.patch @@ -43,20 +43,21 @@ index 5a42ae5..bec0ba9 100644 const lastEdge = edges[edges.length - 1]; const lowerBound = after != null ? afterOffset + 1 : 0; diff --git a/node_modules/graphql-relay/connection/connection.d.ts b/node_modules/graphql-relay/connection/connection.d.ts -index b6a0e45..0b89ee6 100644 +index b6a0e45..bcc32f6 100644 --- a/node_modules/graphql-relay/connection/connection.d.ts +++ b/node_modules/graphql-relay/connection/connection.d.ts -@@ -64,7 +64,9 @@ export interface ConnectionConfig { +@@ -64,7 +64,10 @@ export interface ConnectionConfig { resolveNode?: GraphQLFieldResolver; resolveCursor?: GraphQLFieldResolver; edgeFields?: Thunk>; ++ edgeType?: GraphQLNamedType | GraphQLNonNull; + edgeInterfaces?: GraphQLInterfaceType[]; connectionFields?: Thunk>; + connectionInterfaces?: GraphQLInterfaceType[]; } export interface GraphQLConnectionDefinitions { -@@ -72,6 +74,8 @@ export interface GraphQLConnectionDefinitions { +@@ -72,6 +75,8 @@ export interface GraphQLConnectionDefinitions { connectionType: GraphQLObjectType; } From b78dc99341b5df3f93c2ad0cd435b85f3742c991 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Wed, 13 Dec 2023 14:42:14 +0100 Subject: [PATCH 26/26] fix: rebase conflict --- src/schema/v2/filterArtworksConnection.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schema/v2/filterArtworksConnection.ts b/src/schema/v2/filterArtworksConnection.ts index f70c50c3a6..f152896fd6 100644 --- a/src/schema/v2/filterArtworksConnection.ts +++ b/src/schema/v2/filterArtworksConnection.ts @@ -2,7 +2,7 @@ import { pageable } from "relay-cursor-paging" import { convertConnectionArgsToGravityArgs, removeNulls, - removeEmptyValues, + removeObjectEmptyValues, isExisty, } from "lib/helpers" import { @@ -491,9 +491,9 @@ const filterArtworksConnectionTypeFactory = ( info ) => { const argsProvidedAtRoot = convertFilterArgs(rootArguments as any) - removeEmptyValues(argsProvidedAtRoot) + removeObjectEmptyValues(argsProvidedAtRoot) const argsProvidedInInput = convertFilterArgs(input ?? {}) - removeEmptyValues(argsProvidedInInput) + removeObjectEmptyValues(argsProvidedInInput) const options: any = { ...argsProvidedAtRoot,