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

Reuse of query fragments issue #3452

Closed
BrynCooke opened this issue Jul 18, 2023 · 0 comments · Fixed by #3453
Closed

Reuse of query fragments issue #3452

BrynCooke opened this issue Jul 18, 2023 · 0 comments · Fixed by #3453
Assignees

Comments

@BrynCooke
Copy link
Contributor

BrynCooke commented Jul 18, 2023

Federation v2.4.9 enabled a new reuse_query_fragments feature that is causing issues.

apollographql/federation#2639
apollographql/federation-rs#382

We need add an option in the router to enable this but have it disabled by default.

BrynCooke pushed a commit that referenced this issue Jul 18, 2023
@BrynCooke BrynCooke reopened this Jul 18, 2023
BrynCooke added a commit that referenced this issue Jul 18, 2023
### Update router bridge and add option for `reuse_query_fragments`
([Issue #3452](#3452))

Federation v2.4.9 enabled a new feature for [query fragment
reuse](apollographql/federation#2639) that is
causing issues for some users.

A new option has been added to he router config file to opt into this
feature:
```yaml
supergraph:
  experimental_reuse_query_fragments: true
```

The default is disabled.
Fixes #3452

<!-- start metadata -->

**Checklist**

Complete the checklist (and note appropriate exceptions) before a final
PR is raised.

- [ ] Changes are compatible[^1]
- [ ] Documentation[^2] completed
- [ ] Performance impact assessed and acceptable
- Tests added and passing[^3]
    - [ ] Unit Tests
    - [ ] Integration Tests
    - [ ] Manual Tests

**Exceptions**

*Note any exceptions here*

**Notes**

[^1]. It may be appropriate to bring upcoming changes to the attention
of other (impacted) groups. Please endeavour to do this before seeking
PR approval. The mechanism for doing this will vary considerably, so use
your judgement as to how and when to do this.
[^2]. Configuration is an important part of many changes. Where
applicable please try to document configuration examples.
[^3]. Tick whichever testing boxes are applicable. If you are adding
Manual Tests:
- please document the manual testing (extensively) in the Exceptions.
- please raise a separate issue to automate the test and label it (or
ask for it to be labeled) as `manual test`

---------

Co-authored-by: bryn <bryn@apollographql.com>
BrynCooke added a commit that referenced this issue Jul 20, 2023
> **Note**
>
> When approved, this PR will merge into **the `1.25.0` branch** which
will — upon being approved itself — merge into `main`.
>
> **Things to review in this PR**:
> - Changelog correctness (There is a preview below, but it is not
necessarily the most up to date. See the _Files Changed_ for the true
reality.)
>  - Version bumps
>  - That it targets the right release branch (`1.25.0` in this case!).
>
---
## 🚀 Features

### Persisted Queries w/opt-in safelisting (preview) ([PR
#3347](#3347))

> ⚠️ **Persisted queries is an [Enterprise
feature](https://www.apollographql.com/blog/platform/evaluating-apollo-router-understanding-free-and-open-vs-commercial-features/)
of the Apollo Router.** It requires an organization with a [GraphOS
Enterprise plan](https://www.apollographql.com/pricing/) and the feature
to be enabled for your account.
>
> If your organization _doesn't_ currently have an Enterprise plan, you
can test out this functionality by signing up for a free [Enterprise
trial](https://www.apollographql.com/docs/graphos/org/plans/#enterprise-trials)
and reaching out to enable the feature for your account.

Persisted Queries gives you the tools to prevent unwanted traffic from
reaching your graph.

It has two modes of operation:
* **Unregistered operation monitoring**
* Your router can allow all GraphQL operations, while emitting
structured traces containing unregistered operation bodies.
* **Operation safelisting**
  * Reject unregistered operations
  * Require all operations to be sent as an ID

Unlike automatic persisted queries (APQ), the ability to create a
safelist of operations allows you to prevent a malicious actor from
constructing a free-format query that could overload your subgraphh
services.

For more information con how to register queries and configure your
router see the [Persisted Query
documentation](https://www.apollographql.com/docs/graphos/routing/persisted-queries).

By [@EverlastingBugstopper](https://github.com/EverlastingBugstopper) in
#3347

## 🐛 Fixes

### Fix prometheus statistics issues with _total_total names([Issue
#3443](#3443))

When producing prometheus statistics the otel crate (0.19.0) now
automatically appends `_total` which is unhelpful.

This fix removes `_total_total` from our statistics. However, counter
metrics will still have `_total` appended to them if they did not so
already.

By [@garypen](https://github.com/garypen) in
#3471

### Enforce default buckets for metrics ([PR
#3432](#3432))

When `telemetry.metrics.common` was not configured, no default metrics
buckets were configured.
With this fix by default it set these buckets: `[0.001, 0.005, 0.015,
0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 1.0, 5.0, 10.0]`

By [@bnjjj](https://github.com/bnjjj) in
#3432

## 📃 Configuration

### Add `subscription.enabled` field to enable subscription support
([Issue #3428](#3428))

`enabled` is now required in `subscription` configuration. Example:

```yaml
subscription:
  enabled: true
  mode:
    passthrough:
      all:
        path: /ws
```

By [@bnjjj](https://github.com/bnjjj) in
#3450

### Add option to disable reuse of query fragments ([Issue
#3452](#3452))

A new option has been added to the Router to allow disabling of the
reuse of query fragments. This is useful for debugging purposes.
```yaml
supergraph:
  experimental_reuse_query_fragments: false
```

The default value depends on the version of federation.

By [@BrynCooke](https://github.com/BrynCooke) in
#3453

## 🛠 Maintenance

### Coprocessor: Set a default pool idle timeout duration. ([PR
#3434](#3434))

The default idle pool timeout duration in Hyper can sometimes trigger
situations in which an HTTP request cannot complete (see [this
comment](hyperium/hyper#2136 (comment))
for more information).

This changeset sets a default timeout duration of 5 seconds.

By [@o0Ignition0o](https://github.com/o0Ignition0o) in
#3434

---------

Co-authored-by: bryn <bryn@apollographql.com>
Co-authored-by: Chandrika Srinivasan <chandrikas@users.noreply.github.com>
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 a pull request may close this issue.

1 participant