Skip to content

fix(engine-v2): Mixed up enum values#1766

Merged
Finistere merged 1 commit intomainfrom
gb-6873-wrong-enum-sent-to-subgraph
Jun 12, 2024
Merged

fix(engine-v2): Mixed up enum values#1766
Finistere merged 1 commit intomainfrom
gb-6873-wrong-enum-sent-to-subgraph

Conversation

@Finistere
Copy link
Copy Markdown
Contributor

@Finistere Finistere commented Jun 11, 2024

Incorrectly used indices, which ended up mixing enums.

@linear
Copy link
Copy Markdown

linear bot commented Jun 11, 2024

@Finistere Finistere force-pushed the gb-6873-wrong-enum-sent-to-subgraph branch from 8ec99ac to ca30e91 Compare June 11, 2024 21:22
@Finistere Finistere marked this pull request as ready for review June 12, 2024 06:49
@Finistere Finistere requested a review from a team as a code owner June 12, 2024 06:49
@Finistere Finistere requested a review from tomhoule June 12, 2024 06:49
Copy link
Copy Markdown
Contributor

@tomhoule tomhoule left a comment

Choose a reason for hiding this comment

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

Nice fix!

match self.graph[value_ids].binary_search_by(|enum_value| self.ctx.strings[enum_value.name].as_str().cmp(name))
{
Ok(id) => Ok(SchemaInputValue::EnumValue(EnumValueId::from(id))),
Ok(id) => Ok(SchemaInputValue::EnumValue(r#enum.value_ids.get(id).unwrap())),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So we were getting the value with id(x), say, 3, instead of the third value inside the range, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

so easy to miss with simple tests

@Finistere Finistere merged commit f5d303d into main Jun 12, 2024
@Finistere Finistere deleted the gb-6873-wrong-enum-sent-to-subgraph branch June 12, 2024 07:11
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the postgres connector (https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two tables. See the pull request (#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for federated graphs. #1766
@tomhoule tomhoule mentioned this pull request Jun 13, 2024
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the postgres connector (https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two tables. See the pull request (#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for federated graphs. #1766
- Expand the scope of files watched for changes in `grafbase dev`. #1774
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the postgres connector (https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two tables. See the pull request (#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for federated graphs. #1766
- Expand the scope of files watched for changes in `grafbase dev`. #1774
tomhoule added a commit that referenced this pull request Jun 13, 2024
Features

- You can now filter on text columns with the LIKE operator on the
postgres connector
(https://www.postgresql.org/docs/current/functions-matching.html). #1764
- The postgres connector now uses a connection pool instead of a single
connection in `grafbase start`. #1771
- The postgres connector now supports multiple relations between two
tables. See the pull request
(#1770) for an example.
- Fixed a bug with enum values sent to subgraphs in `grafbase dev` for
federated graphs. #1766
- Expand the scope of files watched for changes in `grafbase dev`. #1774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants