Comments (14)
@alessbell it works as a charm after bumping @wry/trie: 5
. Thank you for your time in this one. I can't remember why on earth I had this dep pinned.
eslint errors are gone too!
from apollo-client.
I think the problem is with Hermes WeakRef
used by toBeGarbageCollected.ts
: facebook/react-native#42742
from apollo-client.
Glad to hear it, @efstathiosntonas!
from apollo-client.
@efstathiosntonas would you mind opening a separate issue for that and I'll x-link to your comment above? Will take a look, thanks!
from apollo-client.
Great find, @efstathiosntonas, and funny timing: I see it was opened yesterday with tracking issues on the Hermes project going back to at least 2021.
That does seem possibly relevant, but toBeGarbageCollected.ts
contains testing matchers used by our Apollo Client test suite that shouldn't wind up in your bundle. One of our maintainers is out sick today and I'm still investigating this, thanks for your patience.
from apollo-client.
@alessbell you're right 🤦 , should have noticed the file path!
from apollo-client.
Thanks for sharing your demo, @efstathiosntonas (moving our thread over here 😊).
please note that i cannot reproduce it
I also can't reproduce it in our rn-apollo-client-testbed
repo that uses codegen (all dependencies on latest
). Can you confirm which versions you're using of all relevant dependencies?
from apollo-client.
these are the codegen versions:
{
"@graphql-codegen/add": "5.0.0",
"@graphql-codegen/cli": "5.0.0",
"@graphql-codegen/fragment-matcher": "5.0.0",
"@graphql-codegen/introspection": "4.0.0",
"@graphql-codegen/jsdoc": "3.0.0",
"@graphql-codegen/typescript": "4.0.1",
"@graphql-codegen/typescript-apollo-client-helpers": "3.0.0",
"@graphql-codegen/typescript-operations": "4.0.1",
"@graphql-codegen/typescript-react-apollo": "4.1.0",
"@graphql-eslint/eslint-plugin": "3.20.1",
}
and codegen.yml:
schema:
- "http://localhost:9091/v1/graphql":
headers:
x-hasura-admin-secret: myadminsecretkey
# - "directive @connection(key: String, filter: [String]) on FIELD"
watch: true
require:
- ts-node/register
documents: 'src/**/*.graphql'
emitLegacyCommonJSImports: false
config:
scalars:
DateTime: Date
JSON: "{ [key: string]: any }"
timestamptz: string
numeric: number
overwrite: true
generates:
./src/generated/apollo-helpers.ts:
plugins:
- typescript-apollo-client-helpers
./src/generated/graphql.tsx:
schema: schema.json
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
- 'jsdoc'
- add:
content: "/* eslint-disable */"
config:
constEnums: true
#immutableTypes: true
preResolveTypes: true
defaultMapper: any
reactApolloVersion: 3
skipTypename: false
avoidOptionals: true
maybeValue: T
withHooks: true
withComponent: false
withHOC: false
withRefetchFn: true
hooks:
afterOneFileWrite:
- prettier --write
./src/graphql.schema.json:
plugins:
- "introspection"
config:
minify: true
hooks:
afterOneFileWrite:
- prettier --write
./src/generated/fragments.tsx:
plugins:
- fragment-matcher
- add:
content: "/* eslint-disable */"
config:
useExplicitTyping: true
hooks:
afterAllFileWrite:
- prettier --write
edit: my eslint throws errors everywhere as you can see on the first comment
from apollo-client.
Thanks for that @efstathiosntonas 👍
I'm looking into the eslint errors you're seeing as possibly distinct from the runtime error of inFlightLinkObservables_1.remove is not a function
(could be same root cause but maybe not). I'm still getting set up to reproduce your eslint/codegen config.
On the runtime error, can you please confirm you have the transitive dependency @wry/trie
v0.5.0 in your node_modules? It's a dependency of Apollo Client's that we bumped in v3.9.0 so I'm not sure why you'd have an incompatible version after upgrading, but want to confirm.
from apollo-client.
ahhhh, I got @wry/trie pinned to 0.4.3 on resolutions
, let me try that.
from apollo-client.
Aha, that would do it! Out of curiosity: do you remember why you pinned that in the first place? Hoping that resolves the eslint errors you're seeing too :)
from apollo-client.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
from apollo-client.
@alessbell just an update, eslint errors are not gone, I guess this is codegen issue now.
from apollo-client.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.
from apollo-client.
Related Issues (20)
- [Data masking] Mask named fragment data returned from mutations HOT 2
- [Data masking] Mask named fragments for data returned from subscriptions HOT 2
- [Data masking] Mask named fragments from data returned in `cache.readQuery` HOT 2
- [Data masking] Mask named fragments for data returned in `cache.readFragment` HOT 2
- [Data masking] Ensure data masking can lookup fragments from the fragment registry HOT 2
- Why does cache read and write operation takes a lot of time when we define client-side variable to a fragment? HOT 3
- [Data masking] Ensure data masking properly handles `null` as top-level, array item, or field with child selection set HOT 2
- [Data masking] Ensure data masking works with `@defer` payloads
- [Data masking] Provide solution for TypeScript type compatibility for APIs that use both the masked result and full result HOT 2
- [Data masking] Warning for field in migrate mode is overagressive
- Websockets can't connect through reverse proxy HOT 2
- useQuery polling query does not stop issuing network requests when the skip argument switches from false to true HOT 3
- `useFragment` does not re-render as expected in v3.11.5 HOT 4
- UseFragment producing a warning during store misses (TypeError: Cannot read properties of undefined) HOT 6
- Cannot read properties of undefined (reading 'data') HOT 19
- Still no alternative to onCompleted change in 3.8 HOT 5
- useSuspenseQuery with skipToken still requires an apolloClient HOT 7
- skip: true and skipToken behave differently with useSuspenseQuery HOT 1
- "Cursor-based pagination" documentation include invalid examples for merge & read
- 3.11.8版本依然存在 Cannot read properties of undefined (reading 'data')问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-client.