cruddl icon indicating copy to clipboard operation
cruddl copied to clipboard

Apollo Federation and ArangoSearch

Open itsezc opened this issue 6 years ago • 9 comments

Is Cruddl compatible with Apollo Federation? if so are there any working examples of it?

And also, is there any plans to support ArangoSearch in the future?

itsezc avatar Sep 29 '19 20:09 itsezc

I don't think there is anything preventing you from embedding a cruddl-generated schema into Apollo Federation, but it might be a little tricky to incorporate all the features. I haven't used it myself, but as far as I understand, it needs a SDL of all federated schemas that can include some directives defined by Apollo. If you don't need any special directives in the cruddl schema, this should not be a problem. However, if you want to add directives, you would need to add them programatically to a SDL generated from the cruddl-generated schema.

And also, is there any plans to support ArangoSearch in the future?

Yes, and it's already implemented, but not released yet. If you want to test it, you can use [email protected].

Yogu avatar Oct 02 '19 13:10 Yogu

Apollo Federation has a known bug with directives which might prevent this without a workaround.

robross0606 avatar Oct 02 '19 13:10 robross0606

My suggestion would be to use printSchema on the cruddl-generated schema which does not have any directives, so custom cruddl directives shouldn't be a problem.

Yogu avatar Oct 02 '19 13:10 Yogu

The suggested workaround using mergeSchema() does also appear to work if needed for some reason. I've tested it with (non-cruddl) custom directives on our federation.

robross0606 avatar Oct 02 '19 13:10 robross0606

The suggested workaround using mergeSchema() does also appear to work if needed for some reason. I've tested it with (non-cruddl) custom directives on our federation.

Yup, tried it with printSchema works like a charm (:

Will be playing around with Foxx and Cruddl together and see how well they go together

Also OFT: I've submitted Cruddl to https://stackshare.io would be nice to have a logo as its an opportunity to increase awareness.

itsezc avatar Oct 05 '19 05:10 itsezc

Looks like we are trying to do the same thing. DevOps setup - each domain maintained by a team, arango+cruddl for fast/simple code generation. federation at the top.

orefalo avatar Oct 22 '19 13:10 orefalo

I've been researching the topic over the last few days.

Official Spec

Spec: https://www.apollographql.com/docs/apollo-server/federation/federation-spec/

Postgraphile implementation of federation

Thread: https://github.com/graphile/postgraphile/issues/1094 Project: https://github.com/graphile/federation

Interesting

Finally, I found this really interesting project: https://github.com/0xR/graphql-transform-federation test project: https://github.com/0xR/graphql-transform-federation-blog

orefalo avatar Nov 02 '19 13:11 orefalo

@itsezc :

Yup, tried it with printSchema works like a charm (:

I can not figure out how to use printSchema for that matter ... could you explain ?

  • The output of printSchema being a string in Schema Langage, how to add dynamically the @keys(fields),extend type.....
  • or do you save it in a separate file then change it to be Apollo Federation compatible ?

Thnks

dijbi avatar Apr 15 '20 20:04 dijbi

@itsezc :

Yup, tried it with printSchema works like a charm (:

I can not figure out how to use printSchema for that matter ... could you explain ?

  • The output of printSchema being a string in Schema Langage, how to add dynamically the @keys(fields),extend type.....
  • or do you save it in a separate field then change it to be Apollo Federation compatible ?

Thnks

The latter, however it's pretty hacky but need not worry we just have to wait for https://github.com/apollographql/apollo-server/pull/3013 to be resolved

itsezc avatar Apr 16 '20 04:04 itsezc