Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression in 0.8.7 due to multiple instances of graphql? #267

Open
mattkrick opened this issue Jan 21, 2025 · 0 comments
Open

Comments

@mattkrick
Copy link

Hi there! When trying to upgrade, I kept getting the following error:

Error: unsupported type: String!

While debugging, I saw that isNonNullType was returning false when it shouldn't for String! in the following compiled code.

if ((0, import_graphql.isNonNullType)(type)) {
    type = type.ofType;
    const nullErrorStr = `"Cannot return null for non-nullable field ${parentType.name}.${getFieldNodesName(fieldNodes)}."`;
    body += `(${GLOBAL_NULL_ERRORS_NAME}.push(${createErrorObject(
      context,
      fieldNodes,
      previousPath,
      nullErrorStr
    )}), null) :`;
    errorDestination = GLOBAL_NULL_ERRORS_NAME;
  } 

Digging deeper, I saw it was because import_graphql was coming from the following webpackified package:

/***/ 500722:
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

whereas e.g. definitions were coming from a different ESM package, which i didn't install, but I believe is used internally by this package

/***/ 763754:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";


Object.defineProperty(exports, "__esModule", ({
  value: true,
}));

Since isNonNullType uses instanceof internally, I assume the use of different graphql packages is the culprit. I only have 1 graphql installed in my project, so I was wondering if it's because of #252 or #257?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant