After upgrade from 1.1.0 to 1.2.0-beta.1 or 2, mutation fails with "Input has too many columns."
See original GitHub issueA mutation that used to work in 1.1.0 no longer works in 1.2.0-beta.1 and beta.2.
The table schema is
CREATE TABLE public."user" (
id integer NOT NULL,
username character varying,
name character varying DEFAULT ''::character varying,
location text,
timezone text,
delivery_time_1 text,
delivery_time_2 text,
is_prime boolean DEFAULT false NOT NULL,
location_google_place_id text,
last_delivery_1 timestamp with time zone DEFAULT now() NOT NULL,
last_delivery_2 timestamp with time zone DEFAULT now() NOT NULL,
next_delivery timestamp with time zone,
CONSTRAINT delivery_times_different CHECK ((delivery_time_1 <> delivery_time_2)),
CONSTRAINT user_username_valid CHECK (((username)::text ~* '^[a-z\d]{1,20}$'::text))
);
mutation ($delivery_time_1: time_of_day_enum!, $delivery_time_2: time_of_day_enum) {
update_user(_set: {delivery_time_1: $delivery_time_1, delivery_time_2: $delivery_time_2}, where: {}) {
returning {
id
delivery_time_1
delivery_time_2
next_delivery_string
__typename
}
__typename
}
}
with variables:
{
"delivery_time_1": "morning",
"delivery_time_2": null
}
The error logged by Postgres:
2020-03-05 17:29:04.682 UTC [30] ERROR: cannot cast type record to "user" at character 901
2020-03-05 17:29:04.682 UTC [30] DETAIL: Input has too many columns.
2020-03-05 17:29:04.682 UTC [30] STATEMENT: WITH "public_user__mutation_result_alias" AS (UPDATE "public"."user" SET "delivery_time_1" = ($1)::text,"delivery_time_2" = NULL WHERE (((((((("public"."user"."id") = (((current_setting('hasura.user')::json->>'x-hasura-user-id'))::integer)) OR ((("public"."user"."id") IS NULL) AND ((((current_setting('hasura.user')::json->>'x-hasura-user-id'))::integer) IS NULL))) AND ('true')) AND ('true')) AND ('true')) AND ('true')) AND (('true') AND ('true'))) RETURNING * , CASE WHEN 'true' THEN NULL ELSE "hdb_catalog"."check_violation"('update check constraint failed') END ) SELECT json_build_object('returning', (SELECT coalesce(json_agg("root" ), '[]' ) AS "root" FROM (SELECT row_to_json((SELECT "_1_e" FROM (SELECT "_0_root.base"."id" AS "id", "_0_root.base"."delivery_time_1" AS "delivery_time_1", "_0_root.base"."delivery_time_2" AS "delivery_time_2", "public"."user_next_delivery_string"("_0_root.base") AS "next_delivery_string", 'user' AS "__typename" ) AS "_1_e" ) ) AS "root" FROM (SELECT * FROM "public_user__mutation_result_alias" WHERE ('true') ) AS "_0_root.base" ) AS "_2_root" ), '__typename', 'user_mutation_response' )
To replicate:
- I spun up 1.1.0,
- Applied my migrations, verified the mutation worked (migration available upon request)
- Spin up 1.2.0-beta.2
- Mutation fails
Or just:
- Spin up a brand new, empty 1.2.0-beta.1 or beta.2
- Apply migrations
- Mutation fails
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Change multiple column values in Python - FAQs - GraphQL API
I have been able to eliminate it as parse error. If it is a column validation error I am unsure where it is...
Read more >Compose Runtime - Android Developers
Fundamental components of compose UI needed to interact with the device, including layout, drawing, and input. Declaring dependencies. To add a dependency on ......
Read more >Web Libraries in Jars - WebJars
jQuery Tags Input Plugin, org.webjars, jquery-tagsinput, 1.3.2 ... angular-multiple-transclusion, org.webjars.bower, angular-multiple-transclusion, 1.0.0.
Read more >Changelog — Python 3.5.9 documentation
bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to get ... bpo-27514: Make having too many statically nested blocks a SyntaxError ......
Read more >Changelog - Prefect Docs
Changelog. # 1.3.1 beta. Released on September 7, 2022. # Fixes. Fix bug where flows with emoji characters pass flow.validate() , but fail...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What’s
next_delivery_string
? I only seenext_delivery
in the schema…➕ we’re actually seeing this issue with
hasura/graphql-engine:v1.1.0