Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
GraphQLScalarType,
GraphQLSchema,
GraphQLString,
GraphQLUnionType,
} from 'gatsby/graphql'
import pascalcase from 'pascalcase'
const _generateTypeName = joinChar => (...parts) =>
['Prismic', ...parts.map(pascalcase)].join(joinChar)
const generatePublicTypeName = _generateTypeName('')
const generateNamespacedTypeName = _generateTypeName('__')
// Provides the ability to control the return value of Date fields on the
// mocked node. This is required to ensure Gatsby processes the field as a Date
// to provide date arguments like `formatString`.
const GraphQLDate = new GraphQLScalarType({
name: 'Date',
serialize: R.identity,
})
// Provides the ability to control the return value of ImageURL fields on the
// mocked node. This is required to allow setting the image URL when creating
// mock localFile fields.
const GraphQLImageURL = new GraphQLScalarType({
name: 'ImageURL',
serialize: R.identity,
})
const GraphQLPrismicHTML = new GraphQLObjectType({
name: generateNamespacedTypeName('HTML'),
fields: {
html: { type: new GraphQLNonNull(GraphQLString) },
['Prismic', ...parts.map(pascalcase)].join(joinChar)
const generatePublicTypeName = _generateTypeName('')
const generateNamespacedTypeName = _generateTypeName('__')
// Provides the ability to control the return value of Date fields on the
// mocked node. This is required to ensure Gatsby processes the field as a Date
// to provide date arguments like `formatString`.
const GraphQLDate = new GraphQLScalarType({
name: 'Date',
serialize: R.identity,
})
// Provides the ability to control the return value of ImageURL fields on the
// mocked node. This is required to allow setting the image URL when creating
// mock localFile fields.
const GraphQLImageURL = new GraphQLScalarType({
name: 'ImageURL',
serialize: R.identity,
})
const GraphQLPrismicHTML = new GraphQLObjectType({
name: generateNamespacedTypeName('HTML'),
fields: {
html: { type: new GraphQLNonNull(GraphQLString) },
text: { type: new GraphQLNonNull(GraphQLString) },
},
})
const GraphQLPrismicGeoPoint = new GraphQLObjectType({
name: generateNamespacedTypeName('GeoPoint'),
fields: {
latitude: { type: new GraphQLNonNull(GraphQLFloat) },