Getting a Cannot read property 'filter' of undefined error in the buildSchemaFromSDL file in apollo-graphql library when I try to run my server. Does anyone know what the issue might be? If I switch back to just using apollo-server the error is gone.
A clearer stack trace
/Users/androswong/wondrous/services/wondrous-api/node_modules/apollo-graphql/lib/schema/buildSchemaFromSDL.js:16
const sdlRules = specifiedRules_1.specifiedSDLRules.filter(rule => !skippedSDLRules.includes(rule));
^
TypeError: Cannot read property 'filter' of undefined
at Object.<anonymous> (/Users/androswong/wondrous/services/wondrous-api/node_modules/apollo-graphql/lib/schema/buildSchemaFromSDL.js:16:53)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/Users/androswong/wondrous/services/wondrous-api/node_modules/apollo-graphql/lib/schema/index.js:6:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
turns out I just needed to download graphql
Happened to me to, but in apollo-server-express In my case I needed to update graphql.
Would be nice to get less cryptic error (happened also to me)
Most helpful comment
turns out I just needed to download graphql