You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Build graphql from master
git clone https://github.com/graphql/graphql-js.git
cd graphql-js
npm i
npm run build
mv dist ../graphql
cd ../graphql
npm i
npm link
cd ..
# Clone graphql-tools and link graphql we just built
git clone https://github.com/apollographql/graphql-tools.git
cd graphql-tools
npm i
npm link graphql
npm run test
Investigation
Seems like a commit made in March broke how enum values are cached within GraphQLEnumType.
How to reproduce
Investigation
Seems like a commit made in March broke how enum values are cached within GraphQLEnumType.
After this commit, values are stored in a
_valueLookup
map in the constructor. So the following code is now broken as the lookup Map is not updated :https://github.com/apollographql/graphql-tools/blob/4261e1ced8a0b9c31b2e2116cdf13f4d560194af/src/schemaGenerator.ts#L451-L452
Possible solution
The following monky patch does solve the problem.
graphql-js
project does not expose a public API to update the internal lookup map, thus the cast toany
to bypass typescript type checking.Conclusion
Is this kind of patch acceptable ?
The text was updated successfully, but these errors were encountered: