Comments (11)
Sure! Check this repo out: https://github.com/zth/relay/tree/rescript-relay. It's the Relay compiler fork RescriptRelay uses. It's in the compiler/
dir.
Place yourself in the compiler/test-project-res
dir and run cargo build && ../target/debug/relay
. That'll compile the compiler and run it on the test project. You'll see any changes you make reflected there.
Adding @as()
is hopefully fairly straight forward. There should be plenty of examples in the code base.
from rescript-relay.
Currently my project using "rescript": "v11-rc.4" and "rescript-relay": "^2.0.0" with uncurried: true. I have input type in graphQL schema:
input ShippingFeePolicyMutationInput {
amount: Int!
freeShippingThreshold: Int
quantityStep: Int
type: ShippingFeePolicyType!
}
The js output has _type
instead of type
now with this ReScript code.
Mutation.make_shippingFeePolicyMutationInput(~amount=0, ~_type=#FREE, ())
{
amount: 0,
_type: "FREE"
}
from rescript-relay.
The functions and type definition are extracted from the generated modules by rescript-relay.
from rescript-relay.
It's the same issue I've described in the description.
That's because of the PR: rescript-lang/rescript-compiler#6354
Fix in the PR: zth/relay#15
from rescript-relay.
@DZakh Can you check the playground link I've added? I'm wondering why this output has type
.
from rescript-relay.
See rescript-lang/rescript-compiler#6354.
There used to be the logic of mangling object keys up till 11-rc.3
from rescript-relay.
I think the change should be highlighted more in ReScript V11 release notes. It's a breaking change people should know about.
from rescript-relay.
Ah! I confused the setting of playground it was v11-beta.4 not rc.3 😓
from rescript-relay.
I opened an issue rescript-lang/rescript-compiler#6440, if the js output is generated by the return type of the external function, then _type
issue here would be fixed, I guess.
from rescript-relay.
Yes, but I think it'll be quite difficult to make it work. Also, if you noticed, in our case the type has a field called type_
, while external
has a field called _type
.
from rescript-relay.
2.1.0
is out, and should fix this. Reopen if it does not.
from rescript-relay.
Related Issues (20)
- [RFC] Unions as regular variants
- [RFC] Leverage unboxed variants for representing null values
- [RFC] Remove "top level node field transform"
- Clean up "loadQuery" generation
- @relay(plural: true) prevents @connection helpers from being generated
- [V3] Things to port and fix HOT 5
- [Discussion] Enums/Unions and exhaustiveness HOT 5
- %relay ppx: This function is a curried function where an uncurried function is expected HOT 12
- Something went wrong trying to analyze the ReScript project with compiler v11-rc.4 HOT 10
- Compile error with rescript-reason v2 and ReScript 11 rc.4 HOT 2
- Timestamp type generation support HOT 5
- Add algolia search in docusaurus documentation HOT 1
- Fail to update from 2.1.0 to 2.2.0 HOT 3
- The relay_resolver.error support HOT 3
- @preloadable support HOT 1
- BUG: Failure to resolve useBlockingPaginationFragment (and others) HOT 1
- Plugin for Jetbrains Idea HOT 3
- [3.0] Update Getting Started.
- [3.0] Move to rescript.json HOT 2
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 rescript-relay.