confuser/graphql-constraint-directive

Error: Cannot find module `graphql-tag` in `graphql-constraint-directive/apollo4.js`

harnyk opened this issue · 1 comments

harnyk commented

The following error is thrown in production, when graphql-constraint-directive is used with Apollo Server 4:

{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'graphql-tag'\nRequire stack:\n- /var/task/node_modules/graphql-constraint-directive/apollo4.js\n- /var/task/src/graphql/server.js\n- /var/task/src/handler.js\n- /opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js\n- /opt/nodejs/node_modules/datadog-lambda-js/runtime/index.js",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module 'graphql-tag'",
        "Require stack:",
        "- /var/task/node_modules/graphql-constraint-directive/apollo4.js",
        "- /var/task/src/graphql/server.js",
        "- /var/task/src/handler.js",
        "- /opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js",
        "- /opt/nodejs/node_modules/datadog-lambda-js/runtime/index.js",
        "    at ImportModuleError.ExtendedError [as constructor] (/opt/nodejs/node_modules/datadog-lambda-js/runtime/errors.js:113:28)",
        "    at new ImportModuleError (/opt/nodejs/node_modules/datadog-lambda-js/runtime/errors.js:123:42)",
        "    at /opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js:273:31",
        "    at step (/opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js:43:23)",
        "    at Object.throw (/opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js:24:53)",
        "    at rejected (/opt/nodejs/node_modules/datadog-lambda-js/runtime/user-function.js:16:65)"
    ]
}

Context. We do not use graphql-tag module for gql in our code, that's why it is missing.

I suggest you to add it to the dependencies.

velias commented

Duplicate to #151 where it is explained