Skip to content

Conversation

@benny1hk
Copy link
Contributor

Allow using null and empty String and number as the first char in Enum keys, which make easier for legacy mongoose project to migrate.

@nodkz nodkz merged commit a7a5485 into graphql-compose:master Sep 28, 2021
@nodkz
Copy link
Member

nodkz commented Sep 28, 2021

Thanks for contribution

But be aware of a NULL value. According to GraphQL implementation, it can not return null values as NULL in output types. But for input it will work correctly - you pass NULL as a string in arguments it transformed to null in resolver args.

// inside resolvers should be provided real values for null & string
expect(lastResolverInputArg).toEqual(['val1', null, '']);
// in output JSON should be provided keys
// BUT be aware `null` does not converted back to `NULL` string
expect(result).toEqual({ data: { test: ['val1', null, 'EMPTY_STRING'] } });

@github-actions
Copy link

🎉 This PR is included in version 9.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants