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

Feature: Add FTV1 Support via Handler #2132

Merged
merged 6 commits into from
Apr 28, 2022
Merged

Feature: Add FTV1 Support via Handler #2132

merged 6 commits into from
Apr 28, 2022

Conversation

lleadbet
Copy link
Contributor

This adds the ability to properly respond to Apollo Federation v1 (aka ftv1) headers with traces to support field-level traces within Apollo Studio. This feature is entirely optional, and would be opted in as with the existing Apollo Tracing handler.

Sample: https://github.com/lleadbet/apollo-gqlgen-ftv1/blob/master/server.go#L24

To support this, there are two major changes:

  • Added dependency on Protobuf, as Apollo uses it for marshaling the format
  • Updates the RawParams to support passing request headers to Handlers

Beyond that, it adds the plugin itself alongside the source of the protobuff file to be able to use as reference.

Not sure where docs should be updated, however.

I have:

  • Added tests covering the bug / feature (see testing)
  • [] Updated any relevant documentation (see docs)

@coveralls
Copy link

coveralls commented Apr 27, 2022

Coverage Status

Coverage decreased (-0.06%) to 74.671% when pulling 1a5dcfd on lleadbet:master into 0465dcb on 99designs:master.

@lleadbet
Copy link
Contributor Author

Also- if there's a good way to note to coveralls that the protobuf/generated files can be exempt, that'd be ideal since the length of both files is tanking overall coverage.

@@ -14,3 +14,4 @@
.idea/
*.test
*.out
gqlgen
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@StevenACoffman
Copy link
Collaborator

See #2133

@StevenACoffman
Copy link
Collaborator

Also, looks like you need to run:

go mod download google.golang.org/protobuf

@lleadbet
Copy link
Contributor Author

As a followup, this also marks all of Apollo's tests as passing using their test suite:

Language Library Federation 1 Support Federation 2 Support
Go gqlgen
_service
@key (single)
@key (multi)
@key (composite)
@requires
@provides
@ftv1
@link
@Shareable
@tag
@OverRide
@inaccessible

@StevenACoffman StevenACoffman merged commit 9250f9a into 99designs:master Apr 28, 2022
@lleadbet
Copy link
Contributor Author

Same as last time: apollographql/apollo-federation-subgraph-compatibility#89

Will get that pushed through to get it updated.

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

Successfully merging this pull request may close these issues.

3 participants