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

Improve support for Apollo Federation 2.0 #2047

Merged
merged 60 commits into from
Aug 8, 2022
Merged

Improve support for Apollo Federation 2.0 #2047

merged 60 commits into from
Aug 8, 2022

Conversation

patrick91
Copy link
Member

@patrick91 patrick91 commented Jul 27, 2022

Description

While looking at #2044 I found some issues with our support for apollo federation, this PR addresses that, it also improves Mypy and Pyright support

  • Split up tests into multiple files
  • Add a link directive
  • Add federation directives support for input and interface
  • Automatically add the link directive on the schema based on usage
  • Decide if we should keep printing the directives (we do that for v1)
  • Add opt-in into v2
  • check if we have all the directives and that they are defined correctly
  • docs
  • federation support for scalars, enums, enum values and unions

Closes #1827

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Documentation

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #2047 (ef54052) into main (85d9383) will increase coverage by 0.02%.
The diff coverage is 98.72%.

@@            Coverage Diff             @@
##             main    #2047      +/-   ##
==========================================
+ Coverage   98.07%   98.09%   +0.02%     
==========================================
  Files         147      152       +5     
  Lines        5909     6095     +186     
  Branches     1114     1160      +46     
==========================================
+ Hits         5795     5979     +184     
  Misses         58       58              
- Partials       56       58       +2     

@patrick91
Copy link
Member Author

/pre-release

@botberry
Copy link
Member

botberry commented Aug 1, 2022

Pre-release

👋

Pre-release 0.124.0.dev.1659690947 [73f6de5] has been released on PyPi! 🚀
You can try it by doing:

poetry add strawberry-graphql==0.124.0.dev.1659690947

@strawberry-graphql strawberry-graphql deleted a comment from botberry Aug 1, 2022
@patrick91
Copy link
Member Author

/pre-release

@patrick91 patrick91 marked this pull request as ready for review August 4, 2022 19:53
@patrick91
Copy link
Member Author

/pre-release

@botberry
Copy link
Member

botberry commented Aug 4, 2022

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release adds full support for Apollo Federation 2.0. To opt-in you need to
pass enable_federation_2=True to strawberry.federation.Schema, like in the
following example:

@strawberry.federation.type(keys=["id"])
class User:
    id: strawberry.ID

@strawberry.type
class Query:
    user: User

schema = strawberry.federation.Schema(query=Query, enable_federation_2=True)

This release also improves type checker support for the federation.


Here's the preview release card for twitter:

Here's the tweet text:

🆕 Release (next) is out! With full support for Apollo Federation 2! @apollographql

Thanks to @patrick91 for the PR and @vamshiaruru0 for helping with testing ❤️

Get it here 👉 https://github.com/strawberry-graphql/strawberry/releases/tag/(next)

Read more about Federation 2 here: https://www.apollographql.com/blog/announcement/backend/announcing-federation-2/

@patrick91
Copy link
Member Author

/pre-release

docs/guides/federation.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apollo Federation 2
3 participants