Comments (5)
Overall Relay support is not in a good state. The main functionality I wanted to add was to be able to easily annotate Proto message which would do two things. 1) Tell Rejoiner which field to use when populating a value for the ID. 2) Annotate methods with the RelayNode annotation so that Rejoiner can fetch data.
- That makes sense.
- There are a bunch of approaches we could take, annotating protos, annotating Java code, external config file (maybe YAML). Most of Rejoiner was based on Java annotations/code, I'd also like to support proto annotations and this was just a place to experiment (since Relay support itself is experimental). I'm open to supporting all of those options, since I see pros and cons depending on the situation.
- Good idea. Also, if nothing is annotated with
@RelayId
or@RelayNode
I'd hope the schema wouldn't mention Relay at all. - Thanks :-)
- There might be a great opportunity to map Google API design recommendation for pagination (https://aip.dev/158) onto Relay pagination.
from rejoiner.
There is something that is not clear to me...
I'm using graphql-java-kickstart
which implements Relay (for a number of reasons this existed already in the project I'm working on).
Can we use/take advantage of this Relay (and if so, how..) or to fully take advantage of Rejoiner we would have to use Rejoiner's implementation of Relay?
from rejoiner.
@CelsoSantos this is a good question... so relay is really just bunch of additional requirements/assumption about your schema on top of standard GraphQL spec. Btw, I actually don't know what is going to happen if you try to use relay client with the server that does not comply 100% with the requirements (if you find out -let me know).
So I think graphql-java-kickstart provides some utils to add otherwise very repetitive schema annotation so is rejoiner. I don't think you can use rejoiner together with graphql-java-kickstart
, it comes with its own graphql server implementation, in examples they use jetty
I have started this branch for TodoMVC example for relay and rejoiner. This seemed to work, but I have never done it for real use case though... Keep me posted if you go that route...
from rejoiner.
According to the spec, one needs to annotate the proto definition with [(google.api.graphql.relay_options).id = true];
right?
@DianaSuvorova I took a look at your code. I see the @RelayNode
annotation but your protos don't have that annotation. Is that on purpose?
On another note, building protos with Maven using that annotation is producing an error due to being unable to use/find relay.proto
:
[INFO] Processing (java): author.proto
protoc-jar: executing: [/tmp/protocjar14842319688386487255/bin/protoc.exe, -I/workspace/proto, -I/tmp/protocjar14618580364098423728/include, -I/workspace/proto/my-company/ac/author/v1, --java_out=/workspace/proto/target/generated-sources, /workspace/proto/my-company/ac/author/v1/author.proto]
relay.proto: File not found.
my-company/ac/author/v1/author.proto:10:1: Import "relay.proto" was not found or had errors.
my-company/ac/author/v1/author.proto:9:1: warning: Import google/protobuf/empty.proto is unused.
[ERROR] /workspace/proto/evooq/ac/author/v1/author.proto [0:0]: relay.proto: File not found.
[ERROR] /workspace/proto/evooq/ac/author/v1/author.proto [10:1]: Import "relay.proto" was not found or had errors.
[ERROR] /workspace/proto/evooq/ac/author/v1/author.proto [9:1]: warning: Import google/protobuf/empty.proto is unused.
[ERROR] /workspace/proto/evooq/ac/author/v1/author.proto [0:0]:
Do I need to replicate/implement relay.proto
locally?
from rejoiner.
I'd be surprised you need to reimplement relay.proto I think it is project's compilation issue.
I see the @RelayNode annotation but your protos don't have that annotation. Is that on purpose?
Yeah, I probably has stopped at this point. Cause I thought it is too far down the stack. Ie I think Relay support gets too invasive if you need to built it in proto defs.
I am probably not very helpful... but would you mind sharing why you decided to go for Relay instead of other GraphQL client (ie apollo) Since I went similar route and while I very much like Relay's approach, guidelines and structure I have decided in favor of Apollo since it was much easier to get up and running and it does not dictate additional requirements on the server part..
would be curious to hear your thoughts
from rejoiner.
Related Issues (20)
- nicer JSON for standard wrappers HOT 11
- google_protobuf_Any value string HOT 1
- Sample/Example if backend GRPC services are in different language?
- Errors executing GraphQL request HOT 2
- Activity? HOT 4
- Request for Help on `GraphQL Stream (based on gRPC streaming)`
- Question: TypeModifcation - Replace field with context
- There is a vulnerability in Jetty: Java based HTTP/1.x, HTTP/2, Servlet, WebSocket Server 9.3.8.v20160314,upgrade recommended
- Missing "TestProto" component
- Question: rejoiner inside existing grpc service? HOT 2
- Exception when starting up Spring Boot 2.7.7/Java 17 app with Rejoiner HOT 2
- proto options not present in input messages
- Documentation website down. Open contributors?
- Documentation website down. Open contributors? HOT 3
- Archive the repository
- Quick Start Guide HOT 2
- How to get Proto object from the parent arguments? HOT 3
- modularization HOT 3
- errors 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 rejoiner.