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

Optionally render entity requires populator function for advanced @requires use cases #2884

Merged
merged 14 commits into from Feb 23, 2024

Conversation

jesse-apollo
Copy link
Contributor

@jesse-apollo jesse-apollo commented Jan 18, 2024

This PR is a refresh of #2676

This new PR utilizes a config flag that makes it optional:

federation:
   filename: graph/federation.go
   package: graph
   options:
     explicit_requires: true

If explicit_requires is enabled a new file called federation.requires.go will be rendered with one or more entity resolver functions populated like:

// PopulateTodoRequires is the requires populator for the Todo entity.
func (ec *executionContext) PopulateTodoRequires(ctx context.Context, entity *model.Todo, reps map[string]interface{}) error {
	panic(fmt.Errorf("not implemented: PopulateTodoRequires"))
}

These are only rendered for entities that have an @requires directive on one or more fields on the entity, example:

type Todo @key(fields:"id") {
  id: ID!
  text: String! @requires(fields: "users { name }")
  done: Boolean! @requires(fields: "user { name }")
  user: User!
  users: [User]
  cost: Int  @provides(fields: "profit { usd }")
  profit: Profit @external
}

type User @key(fields: "id") {
  id: ID!
  name: String!
}

This PR addresses several issues:

We (the Apollo team) think this approach is more flexible and future proof as it handles much more complex use cases like @requires nesting in repeated fields. Our initial approach was to try and extend the existing requires functionality using recursive template rendering but this proved to be complex and difficult to test.

cc @brh55 @dariuszkuc

Todo:

  • Squash commits
  • Write some docs
  • Write a test--might need help with this

I have:

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

@StevenACoffman StevenACoffman added the federation Related to Apollo federation label Jan 18, 2024
@coveralls
Copy link

coveralls commented Jan 18, 2024

Coverage Status

coverage: 74.995% (-0.9%) from 75.884%
when pulling c839ad5 on jesse-apollo:master
into e186813 on 99designs:master.

@StevenACoffman
Copy link
Collaborator

Making this opt-in removes my primary objection to the original that it breaks a lot of existing users who are fine with the current level of support.

@jesse-apollo
Copy link
Contributor Author

Added fixes and tests from @ldebruijn's forked branch.

@ldebruijn
Copy link

Hey! I wanted to contribute to this after not following up on the previos PR attempt.

I can't seem to add commits to this PR, but I've spend some time getting the tests green, this patch contains the changes.
fix__Fix_tests_for_entity_requires.patch

@jesse-apollo
Copy link
Contributor Author

Hi @ldebruijn. Thanks for working on those tests, I was just starting that when I saw your reply. I'm wondering if we should make a new test tree for this instead of reusing testdata/entityresolver?

@@ -382,7 +382,7 @@ func (f *federation) GenerateCode(data *codegen.Data) error {
return err
}

requiresFile := data.Config.Resolver.Dir() + "/federation.requires.go"
requiresFile := data.Config.Federation.Dir() + "/federation.requires.go"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ldebruijn I've reverted this from your proposed change as it breaks the implementation and the test code generation.

@jesse-apollo
Copy link
Contributor Author

jesse-apollo commented Jan 23, 2024

I'm not sure what this failure in running the tests locally means:

    --- FAIL: TestGenerate/default (1.49s)
        generate_test.go:56: Generate() error = merging type systems failed: unable to build object definition: unable to find type: github.com/99designs/gqlgen/api/testdata/default/graph/model.Todo, wantErr false
    --- FAIL: TestGenerate/federation2 (1.57s)
        generate_test.go:56: Generate() error = merging type systems failed: unable to build object definition: unable to find type: github.com/99designs/gqlgen/api/testdata/federation2/graph/model.Todo, wantErr false

@StevenACoffman any ideas where to look?

@ldebruijn
Copy link

Hi @ldebruijn. Thanks for working on those tests, I was just starting that when I saw your reply. I'm wondering if we should make a new test tree for this instead of reusing testdata/entityresolver?

Yes, seems like the better way to go indeed.

* Adding initial docs for explicit requires

* Add example docs for explicit requires
@StevenACoffman
Copy link
Collaborator

I'm not sure what this failure in running the tests locally means:

    --- FAIL: TestGenerate/default (1.49s)
        generate_test.go:56: Generate() error = merging type systems failed: unable to build object definition: unable to find type: github.com/99designs/gqlgen/api/testdata/default/graph/model.Todo, wantErr false
    --- FAIL: TestGenerate/federation2 (1.57s)
        generate_test.go:56: Generate() error = merging type systems failed: unable to build object definition: unable to find type: github.com/99designs/gqlgen/api/testdata/federation2/graph/model.Todo, wantErr false

@StevenACoffman any ideas where to look?

It seems like from the next few comments, you are going to take a different approach, so I haven't bothered to point out why this is happening. Correct me if I'm wrong.

@jesse-apollo
Copy link
Contributor Author

It seems like from the next few comments, you are going to take a different approach, so I haven't bothered to point out why this is happening. Correct me if I'm wrong.

This failure is after the new approach.

@ldebruijn
Copy link

What is left to pull this PR across the finish line?

@StevenACoffman
Copy link
Collaborator

@ldebruijn The same as every PR! For it to pass the existing tests and not break backwards compatibility. While I am in favor of this effort, I'm not driving this forward as I'm consumed with my day job, and the existing federation support is sufficient for my purposes.

@ldebruijn
Copy link

@StevenACoffman don’t get me wrong! I wasn’t insinuating you to be more involved. It was an honest ask for the left over work to get the PR merged.

As far as I can see only the linting job is still failing, is that correct ? @jesse-apollo is that something you’re planning to tackle? I can take a look and supply another changeset, sadly I cannot push commits to this PR.

@ldebruijn
Copy link

From what I can see this is probably the last bit that is still failing the tests. They fail as they observe changes in the generated federation.requires.go file. This is due to the generated resolver functions not having consistent ordering over generate runs.

I've added a sort on the populators to ensure ordering is consistent. The failing checks now pass on my local machine.

fix(federation)__ensure_consistent_ordering_of_generated_resolver_functions.patch

@jesse-apollo
Copy link
Contributor Author

Thanks @ldebruijn I'll get this patch applied and pushed ASAP.

Copy link
Collaborator

@StevenACoffman StevenACoffman left a comment

Choose a reason for hiding this comment

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

Thanks for getting to all tests passing, and it is only failing for the regenerate after you merged master.

It looks like this does not break backwards compatibility for anyone. Is there anything else you would like to do (besides the go generate) before I merge this?

@StevenACoffman StevenACoffman merged commit 15cef76 into 99designs:master Feb 23, 2024
17 checks passed
@StevenACoffman
Copy link
Collaborator

StevenACoffman commented Feb 23, 2024

Thanks for sticking with this and avoiding breaking backwards compatibility while continuing to support more custom use cases!

@mihirpmehta
Copy link

When are we planning to merge this in new version ?

@StevenACoffman
Copy link
Collaborator

@mihirpmehta You do not need to wait for a release. Please do this and immediately use the new functionality:

go mod edit -replace github.com/99designs/gqlgen=github.com/99designs/gqlgen@15cef76f18afec4c5352911360e33f4042500697

I would like a few people to use this functionality and report whether it needs any further improvement before I drop a new release, as this is a significant new feature.

@ldebruijn
Copy link

I've been running it on PRO over the weekend, works perfectly. Adopting the change was a breeze as well. Currently have no suggestions for improvements.

@ericbock
Copy link
Contributor

I'm seeing two issues:

The generated file, in the graph package, is still referencing the package name for types in the package (entity *graph.Boundary here)

package graph

import (
	"context"
	"fmt"
)

// PopulateBoundaryRequires is the requires populator for the Boundary entity.
func (ec *executionContext) PopulateBoundaryRequires(ctx context.Context, entity *graph.Boundary, reps map[string]interface{}) error {
	panic(fmt.Errorf("not implemented: PopulateBoundaryRequires"))
}

@ericbock
Copy link
Contributor

If I remove the graph. in the method signature I run into the second issue.

I'm using the config setting resolvers_always_return_pointers: false

So the modified generated file:

package graph

import (
	"context"
	"fmt"
)

// PopulateBoundaryRequires is the requires populator for the Boundary entity.
func (ec *executionContext) PopulateBoundaryRequires(ctx context.Context, entity *Boundary, reps map[string]interface{}) error {
	panic(fmt.Errorf("not implemented: PopulateBoundaryRequires"))
}

produces the error:

# gitlab.com/armed-atk/development/microservices/system-boundaries/graph
graph/federation.gen.go:100:44: cannot use entity (variable of type Boundary) as *Boundary value in argument to ec.PopulateBoundaryRequires

I think federation.gen.go would need to be updated to account for the resolvers_always_return_pointers setting.

@StevenACoffman
Copy link
Collaborator

PRs are welcome, as are a repository that demonstrates the problem.

ericbock pushed a commit to ericbock/gqlgen_explicit_requires_issue that referenced this pull request Feb 26, 2024
Demonstrates issues with 99designs/gqlgen#2884
@ericbock
Copy link
Contributor

Thanks. I've created https://github.com/ericbock/gqlgen_explicit_requires_issue to demonstrate both issues.

@ericbock
Copy link
Contributor

The generated file, in the graph package, is still referencing the package name for types in the package (entity *graph.Boundary here)

It looks like this is happening when the models are generated into the package (graph) where the federation.requires.go file lives.

@StevenACoffman
Copy link
Collaborator

Interesting! I generally separate the models into a different package than other generated files. We can update the documentation to make this an explicit requirement or add more logic to the code generation.

@ericbock
Copy link
Contributor

I'm not sure how we landed on our configuration here to dump the models into the same package, but we have it in a lot of projects. I'm working on a small patch for the code generation logic which should help.

@jesse-apollo
Copy link
Contributor Author

@ericbock I'm at company kickoff right now but I'll look at creating a PR to address this case as soon as we get back.

@ericbock
Copy link
Contributor

@jesse-apollo It looks like this is all that's involved with respecting the package that the model lives in:

master...ericbock:gqlgen:models_in_pkg#diff-fa028f5dfc54acb372fd0d727ec7e799b93d8dbb34b2769918b7a55bbf051910R123

I haven't been able to get the resolvers_always_return_pointers: false fix done yet though.

@StevenACoffman
Copy link
Collaborator

@ericbock @jesse-apollo If possible, I would like a PR from either of you soon, as this is holding up releasing the next version.

@ericbock
Copy link
Contributor

@StevenACoffman I just created #2965 to address the "models generated in same directory" issue. I haven't had a chance to go back to look at the remaining resolvers_always_return_pointers: false issue, but I don't think it warrants holding back a release.

@jesse-apollo
Copy link
Contributor Author

jesse-apollo commented Mar 11, 2024

Hi @ericbock & @StevenACoffman just back in the saddle today. I've opened a PR for addressing the resolvers_always_return_pointers: false #2966

Let me know what you think, it's very straightforward.

@ericbock
Copy link
Contributor

Looks good to me @jesse-apollo. I was trying to figure it out somehow from the entity itself and go/types, but it's much more straightforward the way you pulled in the config value directly.

@StevenACoffman
Copy link
Collaborator

Thanks! @jesse-apollo @ericbock I have merged both of your PRs, and released a new v0.17.45 that includes them.

Now that #2357 is closed, the Apollo Federation Subgraph Compatibility here https://github.com/apollographql/apollo-federation-subgraph-compatibility/blob/ff24a67687fe96b76edab303f0e2854ea2b9b863/implementations/gqlgen/graph/schema.graphqls#L68 needs to be updated. I made an initial PR apollographql/apollo-federation-subgraph-compatibility#606 that doesn't yet update the gqlgen config nor the populator function, but I'm probably not going to get more time to work on it.

If either of you (or others) find any new Federation-related problems, fast-follow PRs would be very much appreciated. Thanks again!

@suiz0
Copy link

suiz0 commented Mar 19, 2024

QQ: How could I access Resolver dependency within this method?

github-merge-queue bot pushed a commit to infratographer/x that referenced this pull request Apr 2, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/99designs/gqlgen](https://togithub.com/99designs/gqlgen) |
`v0.17.38` -> `v0.17.45` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2f99designs%2fgqlgen/v0.17.45?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2f99designs%2fgqlgen/v0.17.45?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2f99designs%2fgqlgen/v0.17.38/v0.17.45?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2f99designs%2fgqlgen/v0.17.38/v0.17.45?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>99designs/gqlgen (github.com/99designs/gqlgen)</summary>

###
[`v0.17.45`](https://togithub.com/99designs/gqlgen/releases/tag/v0.17.45)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.44...v0.17.45)

#### What's Changed

- Bump github.com/matryer/moq from 0.3.3 to 0.3.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2939
- Bump [@&#8203;apollo/client](https://togithub.com/apollo/client) from
3.9.4 to 3.9.5 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2938
- Bump vitest from 1.2.2 to 1.3.0 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2937
- Bump graphql-ws from 5.14.3 to 5.15.0 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2935
- Bump vite from 5.1.1 to 5.1.3 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2936
- Bump golang.org/x/tools from 0.17.0 to 0.18.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2940
- Optionally render entity requires populator function for advanced
[@&#8203;requires](https://togithub.com/requires) use cases by
[@&#8203;jesse-apollo](https://togithub.com/jesse-apollo) in
[99designs/gqlgen#2884
- Bump vite from 5.1.3 to 5.1.4 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2947
- Bump
[@&#8203;graphql-codegen/introspection](https://togithub.com/graphql-codegen/introspection)
from 4.0.2 to 4.0.3 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2944
- Bump
[@&#8203;graphql-codegen/client-preset](https://togithub.com/graphql-codegen/client-preset)
from 4.2.2 to 4.2.4 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2945
- Bump github.com/PuerkitoBio/goquery from 1.8.1 to 1.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2943
- Bump vitest from 1.3.0 to 1.3.1 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2946
- Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /\_examples by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2955
- Bump github.com/PuerkitoBio/goquery from 1.9.0 to 1.9.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2954
- Bump github.com/stretchr/testify from 1.8.4 to 1.9.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2953
- Add option to omit resolver fields from models by
[@&#8203;Desuuuu](https://togithub.com/Desuuuu) in
[99designs/gqlgen#2957
- fix(docs): convert an unnecessarily capitalized word to lowercase by
[@&#8203;hxrxchang](https://togithub.com/hxrxchang) in
[99designs/gqlgen#2959
- Update explicit_requires to support models generated into same package
by [@&#8203;ericbock](https://togithub.com/ericbock) in
[99designs/gqlgen#2965
- Add case for resolvers_always_return_pointers:false in explicit
requires generation. by
[@&#8203;jesse-apollo](https://togithub.com/jesse-apollo) in
[99designs/gqlgen#2966
- Bump google.golang.org/protobuf from 1.32.0 to 1.33.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2964
- Bump [@&#8203;apollo/client](https://togithub.com/apollo/client) from
3.9.5 to 3.9.6 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2962
- Bump vite from 5.1.4 to 5.1.5 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2961
- Bump typescript from 5.3.3 to 5.4.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2960
- Bump golang.org/x/tools from 0.18.0 to 0.19.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2963

#### New Contributors

- [@&#8203;jesse-apollo](https://togithub.com/jesse-apollo) made their
first contribution in
[99designs/gqlgen#2884
- [@&#8203;hxrxchang](https://togithub.com/hxrxchang) made their first
contribution in
[99designs/gqlgen#2959
- [@&#8203;ericbock](https://togithub.com/ericbock) made their first
contribution in
[99designs/gqlgen#2965

**Full Changelog**:
99designs/gqlgen@v0.17.44...v0.17.45

###
[`v0.17.44`](https://togithub.com/99designs/gqlgen/releases/tag/v0.17.44)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.43...v0.17.44)

#### What's Changed

- Bump vite from 4.3.9 to 4.5.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2885
- Update federation plugin by
[@&#8203;trevor-scheer](https://togithub.com/trevor-scheer) in
[99designs/gqlgen#2876
- Work with https://specs.apollo.dev/federation/v2.x by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[99designs/gqlgen#2891
- Update x/tools and add go v1.21,v1.22 in CI workflows by
[@&#8203;ryicoh](https://togithub.com/ryicoh) in
[99designs/gqlgen#2894
- Bump actions/setup-go from 3 to 5 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2900
- Bump actions/checkout from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2903
- Bump actions/setup-node from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2910
- Bump nick-fields/retry from 2 to 3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2907
- Bump golangci/golangci-lint-action from 3.5.0 to 3.7.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2896
- Bump github.com/stretchr/testify from 1.8.2 to 1.8.4 in /\_examples by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2897
- Bump github.com/gorilla/websocket from 1.5.0 to 1.5.1 in /\_examples
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2901
- Bump github.com/matryer/moq from 0.2.7 to 0.3.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2902
- Bump vitest from 0.32.0 to 1.2.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2919
- Bump styled-components from 5.3.11 to 6.1.8 in /\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2905
- Bump graphql-sse from 2.1.4 to 2.5.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2913
- Bump typescript from 4.9.5 to 5.3.3 in /\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2917
- Bump react-scripts from 2.1.8 to 5.0.1 in /\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2914
- Bump github.com/urfave/cli/v2 from 2.25.5 to 2.27.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2912
- Bump subscriptions-transport-ws from 0.9.19 to 0.11.0 in
/\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2911
- Bump github.com/google/uuid from 1.3.0 to 1.6.0 in /\_examples by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2909
- Bump github.com/rs/cors from 1.9.0 to 1.10.1 in /\_examples by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2904
- Bump graphql from 14.7.0 to 16.8.1 in /\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2899
- Bump jest from 25.5.4 to 29.7.0 in /\_examples/federation by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2920
- Bump typescript from 5.1.3 to 5.3.3 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2921
- Bump
[@&#8203;graphql-codegen/schema-ast](https://togithub.com/graphql-codegen/schema-ast)
from 4.0.0 to 4.0.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2918
- Bump github.com/mattn/go-isatty from 0.0.19 to 0.0.20 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2908
- Bump urql from 4.0.4 to 4.0.6 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2906
- Bump github.com/hashicorp/golang-lru/v2 from 2.0.3 to 2.0.7 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2915
- Bump node-fetch from 2.7.0 to 3.3.2 in /\_examples/federation by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2916
- graphql/uint: Fix unmarshalling of negative numbers by
[@&#8203;mnPanic](https://togithub.com/mnPanic) in
[99designs/gqlgen#2922
- Bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2928
- Bump github.com/google/uuid from 1.3.0 to 1.6.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2924
- Bump github.com/stretchr/testify from 1.8.2 to 1.8.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2925
- Bump google.golang.org/protobuf from 1.30.0 to 1.32.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2926
- Bump react from 16.14.0 to 18.2.0 in /\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2929
- Bump vite from 4.5.2 to 5.1.1 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2931
- Bump
[@&#8203;graphql-codegen/cli](https://togithub.com/graphql-codegen/cli)
from 4.0.1 to 5.0.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2932
- Bump github.com/sosodev/duration from 1.1.0 to 1.2.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2927
- Bump react-dom from 16.14.0 to 18.2.0 in /\_examples/chat by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2930

#### New Contributors

- [@&#8203;trevor-scheer](https://togithub.com/trevor-scheer) made their
first contribution in
[99designs/gqlgen#2876
- [@&#8203;ryicoh](https://togithub.com/ryicoh) made their first
contribution in
[99designs/gqlgen#2894
- [@&#8203;mnPanic](https://togithub.com/mnPanic) made their first
contribution in
[99designs/gqlgen#2922

**Full Changelog**:
99designs/gqlgen@v0.17.43...v0.17.44

###
[`v0.17.43`](https://togithub.com/99designs/gqlgen/releases/tag/v0.17.43)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.42...v0.17.43)

#### What's Changed

- Fix code generation for federated multi-key, multi-entity types by
[@&#8203;bpeters-cmu](https://togithub.com/bpeters-cmu) in
[99designs/gqlgen#2877
- Add config option to omit root objects from models by
[@&#8203;ghjm](https://togithub.com/ghjm) in
[99designs/gqlgen#2878
- add omitempty config to example gqlgen.yml by
[@&#8203;PaulVasilenko](https://togithub.com/PaulVasilenko) in
[99designs/gqlgen#2880
- Update gqlparser to v2.5.11 by
[@&#8203;StevenACoffman](https://togithub.com/StevenACoffman) in
[99designs/gqlgen#2882

#### New Contributors

- [@&#8203;bpeters-cmu](https://togithub.com/bpeters-cmu) made their
first contribution in
[99designs/gqlgen#2877
- [@&#8203;ghjm](https://togithub.com/ghjm) made their first
contribution in
[99designs/gqlgen#2878
- [@&#8203;PaulVasilenko](https://togithub.com/PaulVasilenko) made their
first contribution in
[99designs/gqlgen#2880

**Full Changelog**:
99designs/gqlgen@v0.17.42...v0.17.43

###
[`v0.17.42`](https://togithub.com/99designs/gqlgen/blob/HEAD/CHANGELOG.md#v01742---2023-12-29)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.41...v0.17.42)

- <a
href="https://togithub.com/99designs/gqlgen/commit/7bf0c223aec642d086793698bc2a0d1a6fdb09b4"><tt>[`7bf0c22`](https://togithub.com/99designs/gqlgen/commit/7bf0c223)</tt></a>
release v0.17.42

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/c811d47ec498bdd50591f163e7d23a7524e98280"><tt>c811d47e</tt></a>
fix: avoid panic from tracing on bad request (<a
href="https://togithub.com/99designs/gqlgen/pull/2871">#&#8203;2871</a>)</summary>

This fixes a panic which arises from the tracing components when a
request has some defect which results in an error when creating the
operation context. The transports consistently handle this by calling
`DispatchError(graphql.WithOperationContext(ctx, rc), err)` where `rc`
is the OperationContext which was not correctly constructed. This seems
dangerous, because middleware may assume that if there in an
`OperationContext` in the `context.Context` than they are being invoked
on a normal codepath and can assume their other interceptors have been
invoked in the normal order. Also, using a value returned by a function
which also returned a non-nil error is very unusual. However, I have no
idea what the impact of changing that dangerous behavior in the
transports would be, so I opted to make the tracing component more
resilient instead.

</details></dd></dl>

- <a
href="https://togithub.com/99designs/gqlgen/commit/13bb415268dda837690835e65e331746c8df892b"><tt>[`13bb415`](https://togithub.com/99designs/gqlgen/commit/13bb4152)</tt></a>
fix for entity interfce code gen with related test (<a
href="https://togithub.com/99designs/gqlgen/pull/2868">[#&#8203;2868](https://togithub.com/99designs/gqlgen/issues/2868)</a>)

- <a
href="https://togithub.com/99designs/gqlgen/commit/0354649c0309af6acfe089d12d103060d55a5805"><tt>[`0354649`](https://togithub.com/99designs/gqlgen/commit/0354649c)</tt></a>
Remove archived dependency appdash (<a
href="https://togithub.com/99designs/gqlgen/pull/2866">[#&#8203;2866](https://togithub.com/99designs/gqlgen/issues/2866)</a>)

- <a
href="https://togithub.com/99designs/gqlgen/commit/0d43599cdab22912d4ddd061c3b3ffd5d8da3845"><tt>[`0d43599`](https://togithub.com/99designs/gqlgen/commit/0d43599c)</tt></a>
Update examples go.mod with appdash replacements (<a
href="https://togithub.com/99designs/gqlgen/pull/2863">[#&#8203;2863](https://togithub.com/99designs/gqlgen/issues/2863)</a>)

- <a
href="https://togithub.com/99designs/gqlgen/commit/7dd971c871c0b0159ad26c9bf3095a8ba3780402"><tt>[`7dd971c`](https://togithub.com/99designs/gqlgen/commit/7dd971c8)</tt></a>
Use defer wg.Done() in FieldSet Dispatch (<a
href="https://togithub.com/99designs/gqlgen/pull/2861">[#&#8203;2861](https://togithub.com/99designs/gqlgen/issues/2861)</a>)

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/24ea195cebea095035caf4d23af7f3d75fd0a041"><tt>24ea195c</tt></a>
vikstrous/dataloadgen replaces recommended dataloader package in example
docs (<a
href="https://togithub.com/99designs/gqlgen/pull/2770">#&#8203;2770</a>)</summary>

-   update example for dataloadgen

-   improved example with link to example repo

-   undo unnecessary changes

-   fix wrong signature

-   fix creation of loader

-   Update docs/content/reference/dataloaders.md

</details></dd></dl>

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/42f6e39d48e3a301bf39cd4e8fd180250bc25f2c"><tt>42f6e39d</tt></a>
Allow fields that return root level definitions (<a
href="https://togithub.com/99designs/gqlgen/pull/2858">#&#8203;2858</a>)</summary>

- generate structs for root level definitions to support fields that
return Query, Mutation or Subscription

-   removed unnecessary comment

-   re-ran go generate

***

</details></dd></dl>

- <a
href="https://togithub.com/99designs/gqlgen/commit/682a58dd6af5fda53509fbf4cfa45d23b5bb1c86"><tt>[`682a58d`](https://togithub.com/99designs/gqlgen/commit/682a58dd)</tt></a>
Add go generate for examples so contributors never forget (<a
href="https://togithub.com/99designs/gqlgen/pull/2859">[#&#8203;2859](https://togithub.com/99designs/gqlgen/issues/2859)</a>)

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/e080a96de178520fcfaf5a8d68836981ec4df9a9"><tt>e080a96d</tt></a>
Modify to prevent unreachable code from occurring (<a
href="https://togithub.com/99designs/gqlgen/pull/2846">#&#8203;2846</a>)</summary>

-   fix: 型の数でソートする処理を追加

-   戻し

-   fix: case文の最初にスーパークラスが来ないようにする

-   testdata追加

-   fix: Added sorting by number of types.

- fix: Prevent superclass from appearing at the beginning of case
statement

</details></dd></dl>

- <a
href="https://togithub.com/99designs/gqlgen/commit/68744ad2a1e9d5869ab6a00b49814c6ae9583186"><tt>[`68744ad`](https://togithub.com/99designs/gqlgen/commit/68744ad2)</tt></a>
Bump changelog

- <a
href="https://togithub.com/99designs/gqlgen/commit/e4cf21d24518deb99af6d4c0ea86de11d6889349"><tt>[`e4cf21d`](https://togithub.com/99designs/gqlgen/commit/e4cf21d2)</tt></a>
v0.17.41 postrelease bump

 <!-- end of Commits -->

<!-- end of Else -->

<!-- end of If NoteGroups -->

###
[`v0.17.41`](https://togithub.com/99designs/gqlgen/blob/HEAD/CHANGELOG.md#v01741---2023-12-03)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.40...v0.17.41)

- <a
href="https://togithub.com/99designs/gqlgen/commit/fe60938c55308b1cd5562556cdb976771cfcc6cc"><tt>[`fe60938`](https://togithub.com/99designs/gqlgen/commit/fe60938c)</tt></a>
release v0.17.41

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/5e98a16a3a5a5678f1b6481275d81f52f9462f90"><tt>5e98a16a</tt></a>
fix fieldset.New bug when prefix slice has len < cap (<a
href="https://togithub.com/99designs/gqlgen/pull/2851">#&#8203;2851</a>)</summary>

-   fix fieldset.New bug when prefix slice has len < cap

-   ignore gocritic warning

</details></dd></dl>

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/bd9657f3e50b7b9642c05039a5364ce2262faaf4"><tt>bd9657f3</tt></a>
Improve ResolverImplementer.Implment (<a
href="https://togithub.com/99designs/gqlgen/pull/2850">#&#8203;2850</a>)</summary>

-   improve resolver implement render

-   add error when multiple implementors

-   add initial test

</details></dd></dl>

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/cb3c1c890e5a255776df9577c80b0c15218cf254"><tt>cb3c1c89</tt></a>
Updated apollo sandbox (<a
href="https://togithub.com/99designs/gqlgen/pull/2849">#&#8203;2849</a>)</summary>

Added all supported options to new window.EmbeddedSandbox object

</details></dd></dl>

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/eb5cea7206767bda3582040fd9e4c98174aaa6b1"><tt>eb5cea72</tt></a>
Small template fix to save space in the generated file (<a
href="https://togithub.com/99designs/gqlgen/pull/2841">#&#8203;2841</a>)</summary>

-   Small template fix to save space in the generated file

-   Re-generate

***

</details></dd></dl>

- <a
href="https://togithub.com/99designs/gqlgen/commit/c0ca5091a10417c34192da4d3c064a0fed2a7fdb"><tt>[`c0ca509`](https://togithub.com/99designs/gqlgen/commit/c0ca5091)</tt></a>
Omittable can now be serialized as json (<a
href="https://togithub.com/99designs/gqlgen/pull/2839">[#&#8203;2839](https://togithub.com/99designs/gqlgen/issues/2839)</a>)

- <a
href="https://togithub.com/99designs/gqlgen/commit/dcb7619111642cc82a21b8e80ce1300213af1368"><tt>[`dcb7619`](https://togithub.com/99designs/gqlgen/commit/dcb76191)</tt></a>
fix: sample program indentation (<a
href="https://togithub.com/99designs/gqlgen/pull/2840">[#&#8203;2840](https://togithub.com/99designs/gqlgen/issues/2840)</a>)

<dl><dd><details><summary><a
href="https://togithub.com/99designs/gqlgen/commit/132ec1ce579e9ce3dc772afebf9703c1403d588e"><tt>132ec1ce</tt></a>
Updated GraphiQL 3.0.1 => 3.0.6 (<a
href="https://togithub.com/99designs/gqlgen/pull/2837">#&#8203;2837</a>)</summary>

-   Updated GraphiQL 3.0.1 => 3.0.6

-   Added unit tests to cover integrity of playgrounds

-   Updated vulnerable dependency

-   Close response body

</details></dd></dl>

- <a
href="https://togithub.com/99designs/gqlgen/commit/917407005eb4198aa43875984fb77caeaa7fca36"><tt>[`9174070`](https://togithub.com/99designs/gqlgen/commit/91740700)</tt></a>
v0.17.40 postrelease bump

 <!-- end of Commits -->

<!-- end of Else -->

<!-- end of If NoteGroups -->

###
[`v0.17.40`](https://togithub.com/99designs/gqlgen/releases/tag/v0.17.40)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.39...v0.17.40)

##### What's Changed

- resolver: fix case-insensitive file name collision by
[@&#8203;erankor](https://togithub.com/erankor) in
[99designs/gqlgen#2829
- Bump [@&#8203;babel/traverse](https://togithub.com/babel/traverse)
from 7.22.5 to 7.23.2 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2831
- Map based input types fields are now coerced to the right type by
[@&#8203;endSly](https://togithub.com/endSly) in
[99designs/gqlgen#2830

**Full Changelog**:
99designs/gqlgen@v0.17.39...v0.17.40

###
[`v0.17.39`](https://togithub.com/99designs/gqlgen/releases/tag/v0.17.39)

[Compare
Source](https://togithub.com/99designs/gqlgen/compare/v0.17.38...v0.17.39)

#### What's Changed

- Breaking API: Allow WebsocketInitFunc to add payload to Ack
([#&#8203;4](https://togithub.com/99designs/gqlgen/issues/4)) by
[@&#8203;telemenar](https://togithub.com/telemenar) in
[99designs/gqlgen#2791
- add close flag into wsConnection to avoid duplicate calls of CloseFunc
by [@&#8203;vlad-tokarev](https://togithub.com/vlad-tokarev) in
[99designs/gqlgen#2803
- fix: CodeGen for omit_slice_element_pointers and GetMany Entity
Resolvers by [@&#8203;parkerroan](https://togithub.com/parkerroan) in
[99designs/gqlgen#2802
- feat: update getting-started CreateTodo mutationResolver by
[@&#8203;gitxiongpan](https://togithub.com/gitxiongpan) in
[99designs/gqlgen#2810
- Feature: Support Apollo Federation Auth Directives by
[@&#8203;parkerroan](https://togithub.com/parkerroan) in
[99designs/gqlgen#2809
- Consider go type name when autobinding by
[@&#8203;dany74q](https://togithub.com/dany74q) in
[99designs/gqlgen#2812
- Update generated files that change when building by
[@&#8203;telemenar](https://togithub.com/telemenar) in
[99designs/gqlgen#2813
- Add a pong only keep alive for the new protocol by
[@&#8203;telemenar](https://togithub.com/telemenar) in
[99designs/gqlgen#2814
- Store parsed Schema on ExecutableSchema rather than use global
variable by [@&#8203;gitxiongpan](https://togithub.com/gitxiongpan) in
[99designs/gqlgen#2811
- Add ability to not fail when pong is not received. by
[@&#8203;telemenar](https://togithub.com/telemenar) in
[99designs/gqlgen#2815
- Adding duration scalar conforming to ISO8601 standard by
[@&#8203;rwrz](https://togithub.com/rwrz) in
[99designs/gqlgen#2800
- Bump postcss from 8.4.24 to 8.4.31 in /integration by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[99designs/gqlgen#2819
- Add [@&#8203;interfaceObject](https://togithub.com/interfaceObject)
and [@&#8203;composeDirective](https://togithub.com/composeDirective) at
Federation 2 directive lists. by
[@&#8203;wangmir](https://togithub.com/wangmir) in
[99designs/gqlgen#2821

#### New Contributors

- [@&#8203;vlad-tokarev](https://togithub.com/vlad-tokarev) made their
first contribution in
[99designs/gqlgen#2803
- [@&#8203;parkerroan](https://togithub.com/parkerroan) made their first
contribution in
[99designs/gqlgen#2802
- [@&#8203;dany74q](https://togithub.com/dany74q) made their first
contribution in
[99designs/gqlgen#2812
- [@&#8203;rwrz](https://togithub.com/rwrz) made their first
contribution in
[99designs/gqlgen#2800
- [@&#8203;wangmir](https://togithub.com/wangmir) made their first
contribution in
[99designs/gqlgen#2821

**Full Changelog**:
99designs/gqlgen@v0.17.38...v0.17.39

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/infratographer/x).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjMiLCJ1cGRhdGVkSW5WZXIiOiIzNy4yMzAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
federation Related to Apollo federation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants