Repository navigation
Send input object fields by schema name - #14636
Merged
Merged
Conversation
7 of 16 tasks
grouville
approved these changes
Oct 13, 2026
Input structs use snake_case Rust fields (call_id, agent_name), and serde_graphql_input serialized those identifiers verbatim, so the engine received e.g. `call_id` instead of `callId`. The generator now emits `#[serde(rename = "<schemaName>")]` on every input field. Signed-off-by: Alex Suraci <[email protected]>
The query builder encoded input structs with their snake_case keys, so e.g. LLMMessageOriginInput sent `agent_name`/`reply_to`. Generated input modules now define `__field_names__/0`, mapping each key to its schema field name, and the query builder uses it when encoding structs. Unset (nil) input fields were also encoded as an empty value (`ref:`), which is invalid GraphQL; they are now sent as `null`. Signed-off-by: Alex Suraci <[email protected]>
Input dataclasses have snake_case attributes (call_id, mime_type) and cattrs unstructured them by attribute name. graphql-core's ast_from_value then looks fields up by schema name, so multi-word fields were silently dropped from the query. Generated input classes now define `_graphql_field_names()`, and the converter unstructures Input subclasses with those names as renames. Signed-off-by: Alex Suraci <[email protected]>
vito
force-pushed
the
fix-input-field-names
branch
from
October 21, 2026 02:12
ac31c16 to
b4bb4c9
Compare
vito
force-pushed
the
fix-input-field-names
branch
from
November 6, 2026 19:24
b4bb4c9 to
b7fcb1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GraphQL input objects (e.g.
LLMContentBlockInput { callId, mimeType, ... },LLMMessageOriginInput { agentName, replyTo, ... }) must be sent with the schema's field names. Some SDKs used the generated identifier instead, so multi-word fields went over the wire ascall_id/agent_name, or were dropped.Found while working on #14501. This PR doesn't depend on it.
Affected SDKs and fixes
serde_graphql_inputserialized them as-is (call_id). The generator now emits#[serde(rename = "<schemaName>")]on every input field.agent_name). Generated input modules now define__field_names__/0(struct key → schema name), andQueryBuilderuses it when it encodes structs. Unset (nil) input fields were also encoded as an empty value (ref:), which is invalid GraphQL; they're now sent asnull.call_id). graphql-core'sast_from_valuethen looks fields up by schema name, so multi-word fields were silently dropped. Generated input classes now define_graphql_field_names(), and the converter unstructuresInputsubclasses with those names as renames.Each SDK's core client is regenerated with its generator.
Not affected (checked on
main)json:"callId,omitempty"), andgithub.com/dagger/querybuildermarshals by json tag.callId?: string) and serialized by key.$callId), andAbstractInputObject::__toStringserializes by property name.toMap()uses the schema name as the key.ToKeyValuePairs()uses the schema name as the key.Tests
Unit tests build each query without an engine and check the schema field names:
input_object_fields_use_schema_names(dagger-sdklib.rs), withLLMMessageOriginInput.QueryBuilderTest"encode input object with schema field names".test_input_object_field_nameschecks the unstructured args and the printed DSL against a small schema. It failed onmainwith{'agent_name': ..., 'reply_to': ...}. A codegen test covers the generated_graphql_field_names().Passing locally:
rust-client/test,rust-client/cargo-fmt,elixir-client/sdk-test,elixir-client/codegen-test,elixir-client/lint,python-client/python-310/unit,python-client/python-314/unit,python-client/lint. I also ranpython-client/python-312/unitbefore the fix, and the new Python test failed there as expected. I didn't run the integration tests locally; CI runs them.