Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fields: () => ({
resourceType: {
type: new GraphQLNonNull(
new GraphQLEnumType({
name: 'Subscription_Enum_input',
values: { Subscription: { value: 'Subscription' } },
}),
),
description: 'Type of resource',
},
_id: {
type: require('./element.input.js'),
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
id: {
type: IdScalar,
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
} from "graphql"
import { pageable } from "relay-cursor-paging"
import { connectionFromArraySlice, connectionDefinitions } from "graphql-relay"
import { convertConnectionArgsToGravityArgs } from "lib/helpers"
import { ArtworkType } from "schema/v2/artwork"
import { ShowType } from "schema/v2/show"
import {
GlobalIDField,
NodeInterface,
InternalIDFields,
NullableIDField,
} from "schema/v2/object_identification"
import { MessageType } from "./message"
import { ResolverContext } from "types/graphql"
export const BuyerOutcomeTypes = new GraphQLEnumType({
name: "BuyerOutcomeTypes",
values: {
PURCHASED: {
value: "purchased",
},
STILL_CONSIDERING: {
value: "still_considering",
},
HIGH_PRICE: {
value: "high_price",
},
LOST_INTEREST: {
value: "lost_interest",
},
WORK_UNAVAILABLE: {
value: "work_unavailable",
import { GraphQLEnumType } from 'graphql'
import datasetsConfig from './datasetsConfig'
export const AnyDatasetArgumentType = new GraphQLEnumType({
name: 'DatasetId',
values: Object.keys(datasetsConfig).reduce(
(values, datasetId) => ({ ...values, [datasetId]: {} }),
{}
),
})
const methodSpecificArgumentTypes = {}
export const datasetArgumentTypeForMethod = methodName => {
if (!methodSpecificArgumentTypes[methodName]) {
const typeName = `DatasetsSupporting${methodName.charAt(0).toUpperCase() + methodName.slice(1)}`
const type = new GraphQLEnumType({
name: typeName,
values: Object.keys(datasetsConfig)
.filter(datasetId => datasetsConfig[datasetId][methodName] !== undefined)
import Dimensions from "./dimensions"
import {
GraphQLString,
GraphQLBoolean,
GraphQLObjectType,
GraphQLEnumType,
GraphQLFieldConfig,
GraphQLFloat,
} from "graphql"
import { capitalizeFirstCharacter } from "lib/helpers"
import { Sellable } from "./sellable"
import { ResolverContext } from "types/graphql"
import { listPrice } from "./fields/listPrice"
export const EditionSetSorts = {
type: new GraphQLEnumType({
name: "EditionSetSorts",
values: {
PRICE_ASC: {
value: "price",
},
},
}),
}
const EditionSetAvailabilities = [
"sold",
"on hold",
"on loan",
"permanent collection",
]
return modules
}
const unordered = modules.slice(0)
const reordered = []
preferredOrder.forEach(key => {
remove(unordered, mod => {
if (mod.key === key) {
reordered.push(mod)
return true
}
})
})
return reordered.concat(unordered)
}
const HomePageArtworkModuleTypes = new GraphQLEnumType({
name: "HomePageArtworkModuleTypes",
values: {
ACTIVE_BIDS: {
value: "active_bids",
},
CURRENT_FAIRS: {
value: "current_fairs",
},
FOLLOWED_ARTIST: {
value: "followed_artist",
},
FOLLOWED_ARTISTS: {
value: "followed_artists",
},
FOLLOWED_GALLERIES: {
value: "followed_galleries",
fields: () => ({
resourceType: {
type: new GraphQLNonNull(
new GraphQLEnumType({
name: 'Subscription_Enum_input',
values: { Subscription: { value: 'Subscription' } },
}),
),
description: 'Type of resource',
},
_id: {
type: require('./element.input.js'),
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
id: {
type: IdScalar,
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
fields: () => ({
resourceType: {
type: new GraphQLNonNull(
new GraphQLEnumType({
name: 'MedicationAdministration_Enum_schema',
values: {
MedicationAdministration: { value: 'MedicationAdministration' },
},
}),
),
description: 'Type of resource',
},
_id: {
type: require('./element.schema.js'),
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
id: {
type: IdScalar,
description:
fields: () => ({
resourceType: {
type: new GraphQLNonNull(
new GraphQLEnumType({
name: 'DomainResource_Enum_schema',
values: { DomainResource: { value: 'DomainResource' } },
}),
),
description: 'Type of resource',
},
_id: {
type: require('./element.schema.js'),
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
id: {
type: IdScalar,
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
export const EnumType = (opts: EnumTypeConfig = {}) => <
T extends { new (...args: any[]): {}; [key: string]: any }
>(
target: T
): T => {
let values: GraphQLEnumValueConfigMap = {};
getStaticProperties(target).forEach(name => {
values[name] = {
value: target[name],
description: getDescription(target, name),
deprecationReason: getDeprecationReason(target, name)
};
});
setGraphQLType(
target,
new GraphQLEnumType({
name: opts.name || target.name,
description: opts.description || getDescription(target),
values: values
})
);
return target;
};
fields: () => ({
resourceType: {
type: new GraphQLNonNull(
new GraphQLEnumType({
name: 'Order_Enum_input',
values: { Order: { value: 'Order' } },
}),
),
description: 'Type of resource',
},
_id: {
type: require('./element.input.js'),
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
id: {
type: IdScalar,
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},