sforman
05/23/2022, 2:28 PMgraphql: ^14.0.0 || ^15.0.0
, but not version 16+. From what I can tell, these are all updated on their respective github repos, but not included when installing the serverless stack dependencies.
├─┬ @serverless-stack/cli@1.1.2
│ └─┬ @graphql-codegen/cli@2.6.2
│ ├─┬ @graphql-codegen/core@2.5.1
│ │ └── graphql@16.5.0 deduped invalid: "^14.0.0 || ^15.0.0" from node_modules/@serverless-stack/resources/node_modules/@graphql-tools/merge
│ ├─┬ @graphql-codegen/plugin-helpers@2.4.2
│ │ └── graphql@16.5.0 deduped invalid: "^14.0.0 || ^15.0.0" from node_modules/@serverless-stack/resources/node_modules/@graphql-tools/merge
│ ├─┬ @graphql-tools/apollo-engine-loader@7.2.18
│ │ └── graphql@16.5.0 deduped invalid: "^14.0.0 || ^15.0.0" from node_modules/@serverless-stack/resources/node_modules/@graphql-tools/merge
Error I'm getting is:
ERROR Runtime.UnhandledPromiseRejection: Error: Cannot use GraphQLSchema "{ __validationErrors: undefined, description: undefined, extensions: {}, astNode: { kind: "SchemaDefinition", operationTypes: [Array] }, extensionASTNodes: [], _queryType: Query, _mutationType: undefined, _subscriptionType: undefined, _directives: [@include, @skip, @deprecated, @specifiedBy], _typeMap: { Query: Query, String: String, Boolean: Boolean, __Schema: __Schema, __Type: __Type, __TypeKind: __TypeKind, __Field: __Field, __InputValue: __InputValue, __EnumValue: __EnumValue, __Directive: __Directive, __DirectiveLocation: __DirectiveLocation }, _subTypeMap: {}, _implementationsMap: {} }" from another module or realm.
Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.
<https://yarnpkg.com/en/docs/selective-version-resolutions>
Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
I've tried installing graphql 15.8.0 and using resolutions in my package.json files, none seem to solve the issue.
Any ideas?thdxr
05/23/2022, 2:29 PMsst update snapshot
delete node modules and install againthdxr
05/23/2022, 2:30 PMthdxr
05/23/2022, 2:30 PMthdxr
05/23/2022, 2:31 PMsforman
05/23/2022, 3:11 PMsforman
05/24/2022, 8:58 AMsst update snapshot
solved the issue where peerDependencies didn't have the latest version of graphql, but the graphql mismatch was still present. I uninstalled apollo-server-lambda
and went for @serverless-stack/node/graphql
which worked.
Might be an idea to test with apollo-server-lambda or update your example (linked above) to reflect any changes needed so others don't encounter same issue with apollo
Anyway, thanks for help/links