Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apollo Integration #90

Open
itsezc opened this issue Aug 19, 2019 · 10 comments
Open

Apollo Integration #90

itsezc opened this issue Aug 19, 2019 · 10 comments

Comments

@itsezc
Copy link

itsezc commented Aug 19, 2019

Hello,

I used to use Prisma alot with Apollo, and I'd like to completely replace Prisma with Cruddl, but I have a few questions:

The reason for asking this is because currently (as far as the docs go), I'd have to setup a GraphQL server (Yoga or Apollo) with Cruddl from a GraphQL schema thats written by the developer, then another graphql server has to be made with custom resolvers, and rewrite the typeDefs (too much repetition) to get it all working the way prisma operates now.

Using the schema file as the typeDefs for Apollo server results in missing directives errors

Is there any way to shorten this process? i.e. Ability to overwrite resolvers in the schema generated by Cruddl as I'm aware that Apollo has addResolveFunctionsToSchema({ schema, resolvers }) however there is no API to access the data directly i.e. with Prisma you could do something like:
users: (parent, args, ctx, info) => ctx.db.users(args, info)

Forgive me if the issue is straight forward, I've spent a few days playing around, researching, reading through the docs but this issue isn't referenced anywhere

@itsezc
Copy link
Author

itsezc commented Aug 29, 2019

A demo application (with authentication, custom resolvers) etc. would be awesome for beginners to show / explain the features and limitations of Cruddl, hoping on this with the v1 release.

@Yogu
Copy link
Member

Yogu commented Aug 30, 2019

In our set up, we serve the cruddl-generated schema directly on a server, then have other services that consume the schema of that server. That's the reason we never really needed dev tools to work with cruddl directly. A demo server would be a good idea, though 👍 I'll see what we can do.

@robross0606
Copy link

I think I have a similar situation in our setup. A good portion of our schema will be handled by cruddl. However, some things still need to be handled manually. This is especially true if not all of your graphql API is serviced by Arango. In our case, a portion of the API is a proxy for REST calls, while some serve other functional needs (testing, health check, etc.). My thinking right now is that some combination of schema stitching (merge-graphql, etc.) and/or federation techniques might get me there.

@itsezc
Copy link
Author

itsezc commented Sep 13, 2019

I think I have a similar situation in our setup. A good portion of our schema will be handled by cruddl. However, some things still need to be handled manually. This is especially true if not all of your graphql API is serviced by Arango. In our case, a portion of the API is a proxy for REST calls, while some serve other functional needs (testing, health check, etc.). My thinking right now is that some combination of schema stitching (merge-graphql, etc.) and/or federation techniques might get me there.

If by chance you have any plans to release some examples, I'd be in your debt as I've been looking to tackle this over the past few weeks

@itsezc
Copy link
Author

itsezc commented Sep 23, 2019

In our set up, we serve the cruddl-generated schema directly on a server, then have other services that consume the schema of that server. That's the reason we never really needed dev tools to work with cruddl directly. A demo server would be a good idea, though 👍 I'll see what we can do.

This makes sense, however a typical setup would have Cruddl generate a schema -> write another service preferably in GraphQL again causing alot of repetition, I was hoping on a way to avoid it unless I'm missing something.

My current setup involves Orango (an ORM for ArangoDB) -> Apollo Server -> Apollo Client

with Cruddl (if I'm not misunderstanding) it would be: Cruddl -> Apollo Server -> Apollo Client

but the issue is I have to write a schema for Cruddl then rewrite it again for Apollo Server or atleast do some stitching / overwrite it with second layer causing alot of confusion and complexity, it would be much better if Cruddl can provide some sort of middleware alternative to make this stage easier.

@orefalo
Copy link

orefalo commented Oct 22, 2019

While I don't understand why you need multiple layers of graphQL.

Seems like Apollo federation, and indirectly, the ability for cruddl to generate a compatible federated schema would solve your issue.

That's exactly my use case !

@itsezc
Copy link
Author

itsezc commented Oct 22, 2019

Since the time of my comment, I have done a lot of playing around with this whole issue and I agree (with you @orefalo) that as long as Cruddl is able to generate a compatible federated schema that would make life much easier.

@dijbi
Copy link

dijbi commented Jun 12, 2020

Hi

You can look into graphql-transform-federation for turning cruddl generated schema into a compatible federation schema. I have just begun to play with it, so i don't know if all cases are solved with this solution.
Hope it helps !

@orefalo
Copy link

orefalo commented Jun 13, 2020

would be happy to hear about your feedback -
please comment on the right issue
#101
Tks

@hardikbeladiya
Copy link

@itsezc Hi I have just Added the Authentication and My Custom resolver. contact me know if you are still interested as my code is NDA signed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants