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

TypeError: _1.extractExtensionDefinitions is not a function. (In '_1.extractExtensionDefinitions(astDocument)', '_1.extractExtensionDefinitions' is undefined) #1242

Closed
cris-santos opened this issue Nov 12, 2019 · 3 comments

Comments

@cris-santos
Copy link

react-native: 0.61.2

When I import makeExecutableSchema I get the following error:

"message": "TypeError: _1.extractExtensionDefinitions is not a function. (In '_1.extractExtensionDefinitions(astDocument)', '_1.extractExtensionDefinitions' is undefined)",
"stack": [
  {
    "functionName": "buildSchemaFromTypeDefinitions",
    "lineNumber": 24,
    "columnNumber": 55,
    "fileName": "/node_modules/graphql-tools/dist/generate/buildSchemaFromTypeDefinitions.js"
  },
  {
    "functionName": "makeExecutableSchema",
    "lineNumber": 26,
    "columnNumber": 59,
    "fileName": "/node_modules/graphql-tools/dist/makeExecutableSchema.js"
  },
  {
    "functionName": "setSchema",
    "lineNumber": 9,
    "columnNumber": 38,
    "fileName": "/app/graphql/config/mocks/schema.js"
  },
  {
    "functionName": "setApolloClientMock",
    "lineNumber": 8,
    "columnNumber": 31,
    "fileName": "/app/graphql/config/mocks/client.js"
  },
  {
    "functionName": "<global>",
    "lineNumber": 16,
    "columnNumber": 21,
    "fileName": "/app/components/App/App.js"
  },
  {
    "functionName": "loadModuleImplementation",
    "lineNumber": 322,
    "columnNumber": 6,
    "fileName": "/node_modules/metro/src/lib/polyfills/require.js"
  },
  {
    "functionName": "guardedLoadModule",
    "lineNumber": 201,
    "columnNumber": 45,
    "fileName": "/node_modules/metro/src/lib/polyfills/require.js"
  },
  {
    "functionName": "runUpdatedModule",
    "lineNumber": 657,
    "columnNumber": 17,
    "fileName": "/node_modules/metro/src/lib/polyfills/require.js"
  },
  {
    "functionName": "metroHotUpdateModule",
    "lineNumber": 533,
    "columnNumber": 8,
    "fileName": "/node_modules/metro/src/lib/polyfills/require.js"
  },
  {
    "functionName": "define",
    "lineNumber": 53,
    "columnNumber": 24,
    "fileName": "/node_modules/metro/src/lib/polyfills/require.js"
  },
  {
    "functionName": "global code",
    "lineNumber": 1,
    "columnNumber": 4,
    "fileName": "http://localhost:8081/app/graphql/config/mocks/typeDefs.bundle?platform=ios&dev=true&minify=false&modulesOnly=true&runModule=false&shallow=true"
  },
  {
    "functionName": null,
    "lineNumber": null,
    "columnNumber": null,
    "fileName": "[native code]"
  },
  {
    "functionName": "inject",
    "lineNumber": 62,
    "columnNumber": 35,
    "fileName": "/node_modules/metro/src/lib/bundle-modules/injectUpdate.js"
  },
  {
    "functionName": "forEach",
    "lineNumber": null,
    "columnNumber": null,
    "fileName": "[native code]"
  },
  {
    "functionName": "injectUpdate",
    "lineNumber": 71,
    "columnNumber": 26,
    "fileName": "/node_modules/metro/src/lib/bundle-modules/injectUpdate.js"
  },
  {
    "functionName": "on$argument_1",
    "lineNumber": 40,
    "columnNumber": 21,
    "fileName": "/node_modules/metro/src/lib/bundle-modules/HMRClient.js"
  },
  {
    "functionName": "emit",
    "lineNumber": 202,
    "columnNumber": 37,
    "fileName": "/node_modules/eventemitter3/index.js"
  },
  {
    "functionName": "_ws.onmessage",
    "lineNumber": 72,
    "columnNumber": 20,
    "fileName": "/node_modules/metro/src/lib/bundle-modules/WebSocketHMRClient.js"
  },
  {
    "functionName": "EventTarget.prototype.dispatchEvent",
    "lineNumber": 818,
    "columnNumber": 39,
    "fileName": "/node_modules/event-target-shim/dist/event-target-shim.js"
  },
  {
    "functionName": "_eventEmitter.addListener$argument_1",
    "lineNumber": 232,
    "columnNumber": 27,
    "fileName": "/node_modules/react-native/Libraries/WebSocket/WebSocket.js"
  },
  {
    "functionName": "emit",
    "lineNumber": 190,
    "columnNumber": 12,
    "fileName": "/node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js"
  },
  {
    "functionName": "callFunctionReturnFlushedQueue",
    "lineNumber": null,
    "columnNumber": null,
    "fileName": "[native code]"
  }
]
}
@mroswald
Copy link

I suspect the issue is here: https://github.com/apollographql/graphql-tools/blob/master/src/generate/buildSchemaFromTypeDefinitions.ts#L14

It seems that metro does not correctly resolve '.' to './index', changing the line works for me.
I also had to change these imports in different places (all in src/generate)

@yaacovCR
Copy link
Collaborator

This should hopefully be fixed in https://www.npmjs.com/package/graphql-tools-fork

@yaacovCR
Copy link
Collaborator

Should be fixed in graphql-tools@next, please let us know. Rolled into #1306 .

@yaacovCR yaacovCR mentioned this issue Mar 29, 2020
22 tasks
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

3 participants