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

Federation example #315

Merged
merged 4 commits into from
Sep 4, 2019
Merged

Conversation

smyrick
Copy link
Contributor

@smyrick smyrick commented Sep 3, 2019

Add a federation example with two running spring boot apps and a Node.js app running @apollo/gateway

Here is a query sent to the gateways which resolves data directly from both apps, and also runs a query from base-app (getWidgetById) by then is extended with data from extend-app

Screen Shot 2019-09-04 at 12 08 00 PM

Requires an update from graphql-java first graphql-java/graphql-java#1644
@smyrick smyrick added the type: documentation Documentation or test changes label Sep 3, 2019
@dariuszkuc
Copy link
Collaborator

@smyrick as per the federation docs workaround around graphql-java limitation is to use @extends directive instead (link)

@smyrick
Copy link
Contributor Author

smyrick commented Sep 4, 2019

@dkuc84 Ah I missed that, ok that means graphql-kotlin-federation has a bug right now because the type Query does not have this directive on it

@dariuszkuc
Copy link
Collaborator

@smyrick SDL used by federation is correct but yes there is a mismatch between generated Query type and the SDL returned by the _service { sdl } (https://github.com/ExpediaDotCom/graphql-kotlin/blob/master/graphql-kotlin-federation/src/main/kotlin/com/expedia/graphql/federation/FederatedSchemaGeneratorHooks.kt#L69).

@smyrick smyrick changed the title Start a federation example Federation example Sep 4, 2019
@codecov
Copy link

codecov bot commented Sep 4, 2019

Codecov Report

Merging #315 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #315      +/-   ##
============================================
+ Coverage     93.56%   93.58%   +0.02%     
  Complexity      267      267              
============================================
  Files            76       77       +1     
  Lines           963      967       +4     
  Branches        176      175       -1     
============================================
+ Hits            901      905       +4     
  Misses           36       36              
  Partials         26       26
Impacted Files Coverage Δ Complexity Δ
.../graphql/federation/directives/ExtendsDirective.kt 100% <100%> (ø) 0 <0> (?)
...raphql/federation/FederatedSchemaGeneratorHooks.kt 100% <100%> (ø) 7 <0> (ø) ⬇️
...ia/graphql/generator/extensions/kTypeExtensions.kt 100% <0%> (ø) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7c4c33...27a753b. Read the comment docs.

@smyrick smyrick marked this pull request as ready for review September 4, 2019 19:37
@dariuszkuc
Copy link
Collaborator

Maybe we should put all examples under single example folder?, e.g.

graphql-kotlin
- graphql-kotlin-federation
- graphql-kotlin-schema-generator
- examples
|- spring
|- federation
  |- base-app
  |- extend-app
  |- gateway 

thoughts?

@smyrick smyrick mentioned this pull request Sep 4, 2019
@smyrick
Copy link
Contributor Author

smyrick commented Sep 4, 2019

Yea, I was thinking about that. It would make the top level easier to look at. I will update

Copy link
Collaborator

@dariuszkuc dariuszkuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way we could run both examples during build? unsure about travis but maybe we could utilize github actions?

@smyrick
Copy link
Contributor Author

smyrick commented Sep 4, 2019

@dkuc84 I would love to start using actions, but we need the org admins to opt-in to the feature.

Right now the maven modules are at least compiled

@smyrick smyrick merged commit a13e883 into ExpediaGroup:master Sep 4, 2019
@smyrick smyrick deleted the federation-example branch September 4, 2019 22:38
@smyrick smyrick restored the federation-example branch September 5, 2019 07:12
@smyrick smyrick deleted the federation-example branch September 5, 2019 07:12
smyrick added a commit to smyrick/graphql-kotlin that referenced this pull request Sep 11, 2019
* Start a federation example

Requires an update from graphql-java first graphql-java/graphql-java#1644

* fix federation example

* exclude federation example from code coverage

* Move to top-level examples folder
dariuszkuc pushed a commit to dariuszkuc/graphql-kotlin that referenced this pull request Aug 5, 2022
* Start a federation example

Requires an update from graphql-java first graphql-java/graphql-java#1644

* fix federation example

* exclude federation example from code coverage

* Move to top-level examples folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation Documentation or test changes
Development

Successfully merging this pull request may close these issues.

2 participants