appwish / graphqlapi

GNU Affero General Public License v3.0
12 stars 1 forks source link

Prepare data mocks #3

Closed pjeziorowski closed 4 years ago

pjeziorowski commented 4 years ago

Requirements

It would be nice if we returned some fake data in our graphql server for now (before real implementation is done in other services)

Parables commented 4 years ago

In what directory should this been done. I am a little confused on how this cause I don't know anything about gRPC and Vertx. Am trying to learn them and I have spent quite some time reading docs. I see you have modularised the project. Please recommend some resources I can learn from and throw some light on how you implemented yours

pjeziorowski commented 4 years ago

I'm writing a document that describes all the stuff in graphqlapi / wishservice. I don't know if it will be finished today, MAYBE I'll manage to finish it this night (CET time). I'll let you know when it's ready.

pjeziorowski commented 4 years ago

To mock the data, you would need the graphql schema to be merged (previous task). Then, you need to wire the graphql schema with resolvers/fetchers like here - https://github.com/appwish/graphqlapi/blob/master/src/main/java/io/appwish/graphqlapi/graphql/wiring/WishTypeRuntimeWiring.java

and at the end, implement fetcher like this one:

https://github.com/appwish/graphqlapi/blob/master/src/main/java/io/appwish/graphqlapi/graphql/fetcher/WishFetcher.java

This fetcher actually uses gRPC to talk with wishservice and return some real data. In case of some mock dummy data, you don't need to use gRPC. Your implementation can simply return some hardcoded values.

Parables commented 4 years ago

Okay, waiting for the schema to be merged.... Please let me know if there are any revisions to be done. I know your hands are quite full managing this project. Great job you're doing here.

Parables commented 4 years ago

WishTypeRuntimeWiring has an error: return List.of(wish, allWish, createWish, deleteWish, updateWish); Cannot resolve method 'of(graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,)'

pjeziorowski commented 4 years ago

Which Java version do you use? Seems like Java 8? You need to use 1121 sty 2020 7:17 AM Parables Boltnoel notifications@github.com napisał(a):WishTypeRuntimeWiring has an error: return List.of(wish, allWish, createWish, deleteWish, updateWish); Cannot resolve method 'of(graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,graphql.schema.idl.TypeRuntimeWiring,)'

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

pjeziorowski commented 4 years ago

@Parables - the guide I talked about - https://dev.to/pjeziorowski/react-graphql-grpc-and-reactive-microservices-the-dataflow-in-appwish-platform-explained-34ag

It describes things from a high-level perspective