My mongoose pattern is as follows
var ImageFormats = new Schema({
svg : String,
png-xlarge : String,
png-small : String
});
When I translated this into GraphQL schema, this is what I am trying
export var GQImageFormatsType: ObjectType = new ObjectType({
name: 'ImageFormats',
fields: {
svg : { type: GraphQLString },
'png-xlarge': { type: GraphQLString },
'png-small' : { type: GraphQLString }
}
});
GraphQL Returns the following error: Error: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "png-xlarge" does not.
If I try to simulate GraphQL after my Mongoose model, how can I reconcile fields? Is there a way to create an alias?
(I searched on the graffiti and stackoverflow forums, but couldn't find a similar question)
source
share