urql-graphql / urql-devtools

A tool for monitoring and debugging urql during development
https://formidable.com/open-source/urql/docs/advanced/debugging/#devtools
MIT License
257 stars 11 forks source link

Spurious warning about `__schema` in console #269

Closed mrflip closed 4 years ago

mrflip commented 4 years ago

(I've been advised this bug should be filed against urql core itself, so I've re-filed it there and will close this one.)

I am getting a warning The field__schemadoes not exist onQuery, but the GraphQL document expects it to exist.. @JoviDeCroock on Spectrum advised that likely this is a spurious console warning that should be suppressed.

Just for completeness:

I prepared the schema to feed to the cacheExchange using the script given in the docs, taking it from most recent stable release of apollo-server. Queries work and tools like insomnia happily gather the schema, so I think introspection is working correctly on the server side. The first part of my schema.json file is

{"__schema":{"queryType":{"name":"Query"},"mutationType":{"name":"Mutation"},"subscriptionType":null,"types":[{"kind":"INTERFACE","name":"Node","fields":[{"name":"id","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":[{"kind":"OBJECT","name":"DeleteAdjustment","ofType":null},...

Here is the snipped error callstack from the console:

muteWarnings.fx.ts:22 Invalid field: The field `__schema` does not exist on `Query`, but the GraphQL document expects it to exist.
Traversal will continue, however this may lead to undefined behavior!
(Caused At: "IntrospectionQuery" query)
https://bit.ly/2XbVrpR#4
warn @ muteWarnings.fx.ts:22
z @ urql-exchange-graphcache.mjs:58
E @ urql-exchange-graphcache.mjs:111
Z @ urql-exchange-graphcache.mjs:694
$a @ urql-exchange-graphcache.mjs:646
ab @ urql-exchange-graphcache.mjs:636
d @ urql-exchange-graphcache.mjs:830
(anonymous) @ wonka.mjs:678
(anonymous) @ wonka.mjs:468
(anonymous) @ wonka.mjs:812
b @ wonka.mjs:811
...

I'm using Chrome browser with most recent devtools plugin (Version 2.1.0, installed July 1). Package file:

  "dependencies": {
    "@expo/samples": "~36.0.0",
    "@expo/vector-icons": "^10.0.0",
    "@react-native-community/async-storage": "~1.11.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-native-community/netinfo": "5.9.2",
    "@react-native-firebase/app": "^7.3.0",
    "@react-navigation/core": "^5.11.1",
    "@react-navigation/material-bottom-tabs": "^5.2.12",
    "@react-navigation/native": "^5.6.1",
    "@react-navigation/stack": "^5.6.2",
    "@react-navigation/web": "~1.0.0-alpha.9",
    "@urql/exchange-graphcache": "^3.0.1",
    "@urql/exchange-populate": "^0.1.8",
    "@urql/exchange-retry": "^0.1.8",
    "aws-amplify": "^3.0.18",
    "babel-plugin-transform-object-from-entries": "^1.0.0",
    "expo": "^38.0.0",
    "expo-asset": "~8.1.7",
    "expo-constants": "~9.1.1",
    "expo-device": "~2.2.1",
    "expo-firebase-analytics": "~2.4.1",
    "expo-firebase-core": "~1.1.1",
    "expo-font": "~8.2.1",
    "expo-linking": "^1.0.3",
    "expo-secure-store": "~9.0.1",
    "expo-splash-screen": "~0.3.1",
    "expo-updates": "~0.2.8",
    "expo-web-browser": "~8.3.1",
    "firebase": "7.9.0",
    "formik": "^2.1.4",
    "graphql": "^15.2.0",
    "graphql-tag": "^2.10.3",
    "lodash": "^4.17.15",
    "moment": "^2.27.0",
    "react": "16.11.0",
    "react-dom": "16.11.0",
    "react-hook-form": "^5.7.2",
    "react-native": "https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz",
    "react-native-elements": "^2.0.2",
    "react-native-formik": "^1.7.8",
    "react-native-gesture-handler": "~1.6.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.1",
    "react-native-numeric-input": "https://github.com/himelbrand/react-native-numeric-input.git",
    "react-native-paper": "^3.8.0",
    "react-native-paper-form-builder": "^1.0.6",
    "react-native-reanimated": "~1.9.0",
    "react-native-safe-area-context": "3.0.2",
    "react-native-screens": "~2.9.0",
    "react-native-vector-icons": "^6.6.0",
    "react-native-web": "~0.11.7",
    "sprintf-js": "^1.1.2",
    "urql": "^1.9.8",
    "urql-persisted-queries": "^0.1.0",
    "yup": "^0.29.1"
  },
  "devDependencies": {
    "@babel/cli": "^7.10.3",
    "@babel/core": "^7.10.3",
    "@babel/plugin-transform-modules-commonjs": "^7.10.1",
    "@babel/preset-flow": "^7.10.1",
    "@babel/runtime": "^7.10.3",
    "babel-eslint": "^10.1.0",
    "babel-plugin-import-graphql": "^2.7.0",
    "babel-preset-expo": "^8.2.3",
    "eslint": "^7.3.1",
    "eslint-config-airbnb": "^18.2.0",
    "eslint-plugin-import": "^2.21.1",
    "eslint-plugin-jsx-a11y": "^6.3.1",
    "eslint-plugin-react": "^7.20.0",
    "eslint-plugin-react-hooks": "^4.0.4",
    "eslint-plugin-react-native": "^3.8.1",
    "jest-expo": "^38.0.0",
    "standard-version": "^8.0.0",
    "standard-version-expo": "^1.0.3"
    "@urql/devtools": "^2.0.2",
  },

Happy to gather more data as needed..

mrflip commented 4 years ago

closing in favor of FormidableLabs/urql#889 as requested by @kitten

andyrichardson commented 4 years ago

Thanks for the report and the update @mrflip 🙏