Comments (10)
Oh great question! Actually the way I’ve been using it, due to various transitive dependencies that really should all be using the same versions, is by using yarn’s resolutions feature, which is also how it’s being used in the example app’s setup.
Hope that helps!
from relay-compiler-language-typescript.
@alloy Great! Thanks - I did not understand the resolutions correctly. Thanks again for the great efforts here
from relay-compiler-language-typescript.
Thanks for testing and please give us any feedback on the PR whilst things have not been merged yet!
from relay-compiler-language-typescript.
@alloy So far things are working nice! I do get the errors below when starting the app, but things seem to work as expected.
ERROR in project/packages/modules/example/ts/app.tsx(74,25):
TS2322: Type '{ viewer: any; }' is not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'.
Type '{ viewer: any; }' is not assignable to type 'Props'.
Property 'relay' is missing in type '{ viewer: any; }'.
ERROR in project/packages/modules/example/ts/components/TodoApp.tsx(56,21):
TS2322: Type '{ viewer: TodoApp_viewer; }' is not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'.
Type '{ viewer: TodoApp_viewer; }' is not assignable to type 'Props'.
Property 'relay' is missing in type '{ viewer: TodoApp_viewer; }'.
ERROR in project/packages/modules/example/ts/components/TodoApp.tsx(57,40):
TS2322: Type '{ viewer: TodoApp_viewer; }' is not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'.
Type '{ viewer: TodoApp_viewer; }' is not assignable to type 'Props'.
Property 'relay' is missing in type '{ viewer: TodoApp_viewer; }'.
ERROR in project/packages/modules/example/ts/components/TodoList.tsx(49,9):
TS2322: Type '{ key: string; todo: { readonly id: string; readonly complete: boolean | null; }; viewer: TodoLis...' is not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'.
Type '{ key: string; todo: { readonly id: string; readonly complete: boolean | null; }; viewer: TodoLis...' is not assignable to type 'Props'.
Property 'relay' is missing in type '{ key: string; todo: { readonly id: string; readonly complete: boolean | null; }; viewer: TodoLis...'.
Version: typescript 2.6.2
from relay-compiler-language-typescript.
Are you using the latest versions of the @types/react-relay
and @types/relay-runtime
packages?
from relay-compiler-language-typescript.
Or can you otherwise include a failing code snippet?
from relay-compiler-language-typescript.
@alloy, so this turned out to be a clash with typings. I removed the relay-runtime and react-relay types and it works (I am using latests React).
from relay-compiler-language-typescript.
Did you remove them completely? Or did you remove the clashing ones?
from relay-compiler-language-typescript.
I removed the types for relay-runtime and react-relay and it is working nicely. Would be nice to have the types, but in my case I am fine without.
from relay-compiler-language-typescript.
The typings should be working, though, it does for us at least and otherwise it’s a bug. Could you try to create a minimal example project that exhibits the problem?
from relay-compiler-language-typescript.
Related Issues (20)
- Generated refetch definition with variables can not pass the validation of backend, such as github.com/vektah/gqlparser/v2
- Generate GraphQL fragment files for VSCode GraphQL Extension fragment autocompletion HOT 2
- Cannot read property 'createKeywordTypeNode' of undefined HOT 8
- Support for [email protected] HOT 8
- Migrate travis CI release process to GitHub actions HOT 3
- Unknown directive 'appendNode' HOT 1
- module esnext HOT 2
- Why is it not releasing HOT 7
- `require` substitution is not working HOT 6
- doc: explain why configuration with a single artifact directory is suggested
- Update to TS 4.4 and update types to support exactOptionalPropertyTypes HOT 1
- @stream argument naming by schema spec is: `initialCount` not `initial_count` HOT 1
- Invalid AST Node error with graphql@16 HOT 2
- Typescript 4.5 type generation is broken HOT 6
- Relay Compiler generates Typescript Synthax error HOT 3
- Error: Cannot find module 'relay-compiler-language-typescript' on 15.0
- Fragment Typematching
- Input Types generated as readonly HOT 1
- deprecate this package HOT 1
- Issue with import of the __generated__
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 relay-compiler-language-typescript.