graphql-compose / graphql-compose/graphql-compose-mongoose

How to skip adding enums to the generated schema?

Open
#203 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
706
Forks
98
PR merge metrics
No merged PRs in 30d

Description

I've defined some fields in my mongoose Schemas like the following:

```
{
country: {
type: 'String',
enum: ['United States', 'Great Britain', ...]
}
}
```

which apparently doesn't conform to the GraphQL enum validation criteria, since I'm seeing the following error when trying to `composeWithMongoose` a schema with the above enum:

```
Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "United States" does not.
```

I would like to keep my database-level validation as-is, so is there a way I can generate a GraphQL schema which would just ignore any enum validation?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.