RomainLanz / adonis-graphql

GraphQL Provider for AdonisJs Framework
MIT License
105 stars 18 forks source link

Fatal error when graphql.options is undefined #18

Closed yariksav closed 5 years ago

yariksav commented 5 years ago

I didn't have an defined graphql.config param and after update my aplication falled down

with error "Uncaught TypeError: Cannot convert undefined or null to object" in

https://github.com/RomainLanz/adonis-graphql/blob/678bd93885b2ee241807210adbeae7d156bb3e36/src/Server/index.js#L34

I suppose

this.$options = config.get("graphql.options");

should have an default value, like

this.$options = config.get("graphql.options") || {}
RomainLanz commented 5 years ago

Yup,

Happy to accept a PR!