diff --git a/server/tests-py/queries/graphql_mutation/delete/permissions/agent_delete_perm_arr_sess_var.yaml b/server/tests-py/queries/graphql_mutation/delete/permissions/agent_delete_perm_arr_sess_var.yaml index 1223045e..f52671bf 100644 --- a/server/tests-py/queries/graphql_mutation/delete/permissions/agent_delete_perm_arr_sess_var.yaml +++ b/server/tests-py/queries/graphql_mutation/delete/permissions/agent_delete_perm_arr_sess_var.yaml @@ -6,23 +6,23 @@ response: delete_resident: affected_rows: 1 returning: - - age: 25 - id: 1 + - id: 1 name: Griffin + age: 25 headers: X-Hasura-Role: agent X-Hasura-Allowed-Resident-Ids: '{1,2}' query: query: | - mutation{ - delete_resident( - where: {id: {_eq: 1}} - ){ - affected_rows - returning { - id - name - age - } - } - } + mutation{ + delete_resident( + where: {id: {_eq: 1}} + ){ + affected_rows + returning { + id + name + age + } + } + } diff --git a/server/tests-py/queries/graphql_mutation/delete/permissions/author_can_delete_his_articles.yaml b/server/tests-py/queries/graphql_mutation/delete/permissions/author_can_delete_his_articles.yaml index 98b6d82b..c9ec308e 100644 --- a/server/tests-py/queries/graphql_mutation/delete/permissions/author_can_delete_his_articles.yaml +++ b/server/tests-py/queries/graphql_mutation/delete/permissions/author_can_delete_his_articles.yaml @@ -9,10 +9,10 @@ response: delete_article: affected_rows: 1 returning: - - author_id: 1 - id: 1 + - id: 1 title: Article 1 content: Sample article content 1 + author_id: 1 query: query: | mutation delete_article { diff --git a/server/tests-py/queries/graphql_mutation/insert/basic/author_article.yaml b/server/tests-py/queries/graphql_mutation/insert/basic/author_article.yaml index 42edd55b..c0d5ecd5 100644 --- a/server/tests-py/queries/graphql_mutation/insert/basic/author_article.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/basic/author_article.yaml @@ -60,15 +60,15 @@ data: insert_article: returning: - - content: Sample article content - id: 1 + - id: 1 title: Article 1 - - content: Sample article content - id: 2 + content: Sample article content + - id: 2 title: Article 2 - - content: Sample article content - id: 3 + content: Sample article content + - id: 3 title: Article 3 + content: Sample article content status: 200 query: query: | diff --git a/server/tests-py/queries/graphql_mutation/insert/geojson/insert_landmark.yaml b/server/tests-py/queries/graphql_mutation/insert/geojson/insert_landmark.yaml index 79d0dbc6..a408e10c 100644 --- a/server/tests-py/queries/graphql_mutation/insert/geojson/insert_landmark.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/geojson/insert_landmark.yaml @@ -7,30 +7,46 @@ returning: - id: 1 name: Baz - type: river - location: &loc1 - coordinates: [43.75049, 11.03207] - type: Point - crs: &crs + location: + crs: type: name properties: - name: 'urn:ogc:def:crs:EPSG::4326' + name: urn:ogc:def:crs:EPSG::4326 + type: Point + coordinates: + - 43.75049 + - 11.03207 + type: river - id: 2 name: Foo Bar - type: park - location: &loc2 - coordinates: [43.76417, 11.25869] + location: + crs: + type: name + properties: + name: urn:ogc:def:crs:EPSG::4326 type: Point - crs: *crs + coordinates: + - 43.76417 + - 11.25869 + type: park query: variables: landmarks: - name: Baz type: river - location: *loc1 + location: + coordinates: [43.75049, 11.03207] + type: Point + crs: &crs + type: name + properties: + name: urn:ogc:def:crs:EPSG::4326 - name: Foo Bar type: park - location: *loc2 + location: + coordinates: [43.76417, 11.25869] + type: Point + crs: *crs query: | mutation insertLandmark($landmarks: [landmark_insert_input!]!) { insert_landmark(objects: $landmarks) { diff --git a/server/tests-py/queries/graphql_mutation/insert/nested/articles_with_author.yaml b/server/tests-py/queries/graphql_mutation/insert/nested/articles_with_author.yaml index 578207b5..ddbba43e 100644 --- a/server/tests-py/queries/graphql_mutation/insert/nested/articles_with_author.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/nested/articles_with_author.yaml @@ -2,7 +2,7 @@ description: Insert article and it's author via nested mutation url: /v1/graphql status: 200 query: - query: | + query: |- mutation article_author{ insert_article( objects: [ diff --git a/server/tests-py/queries/graphql_mutation/insert/nested/author_with_articles.yaml b/server/tests-py/queries/graphql_mutation/insert/nested/author_with_articles.yaml index ef39415c..603e92b3 100644 --- a/server/tests-py/queries/graphql_mutation/insert/nested/author_with_articles.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/nested/author_with_articles.yaml @@ -2,22 +2,22 @@ description: Insert author and it's articles via nested mutation url: /v1/graphql status: 200 query: - query: | + query: |- mutation nested_author_insert { insert_author( objects: [ { - name: "Author 3", + name: "Author 3", articles: { data: [ { - title: "Article 1 by Author 3", - content: "Content for Article 1 by Author 3", + title: "Article 1 by Author 3", + content: "Content for Article 1 by Author 3", is_published: false }, { - title: "Article 2 by Author 3", - content: "Content for Article 2 by Author 3", + title: "Article 2 by Author 3", + content: "Content for Article 2 by Author 3", is_published: false } ] diff --git a/server/tests-py/queries/graphql_mutation/insert/onconflict/article_on_conflict_update.yaml b/server/tests-py/queries/graphql_mutation/insert/onconflict/article_on_conflict_update.yaml index a41c63dc..2ac4a050 100644 --- a/server/tests-py/queries/graphql_mutation/insert/onconflict/article_on_conflict_update.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/onconflict/article_on_conflict_update.yaml @@ -1,13 +1,13 @@ description: Upserts article data via GraphQL mutation url: /v1/graphql response: - data: - insert_article: - returning: - - content: Updated Article 1 content - title: Article 1 - - content: Updated Article 2 content - title: Article 2 + data: + insert_article: + returning: + - title: Article 1 + content: Updated Article 1 content + - title: Article 2 + content: Updated Article 2 content status: 200 query: query: | diff --git a/server/tests-py/queries/graphql_mutation/insert/permissions/insert_article_arr_sess_var_editor_allowed_user_id.yaml b/server/tests-py/queries/graphql_mutation/insert/permissions/insert_article_arr_sess_var_editor_allowed_user_id.yaml index 8451aea7..36f8ba50 100644 --- a/server/tests-py/queries/graphql_mutation/insert/permissions/insert_article_arr_sess_var_editor_allowed_user_id.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/permissions/insert_article_arr_sess_var_editor_allowed_user_id.yaml @@ -9,8 +9,8 @@ response: data: insert_article: returning: - - content: Sample article content 4 - title: Article 4 + - title: Article 4 + content: Sample article content 4 query: query: | mutation insert_article { diff --git a/server/tests-py/queries/graphql_mutation/insert/views/nested_insert_article_author_simple_view.yaml b/server/tests-py/queries/graphql_mutation/insert/views/nested_insert_article_author_simple_view.yaml index 6819113a..34f7c13f 100644 --- a/server/tests-py/queries/graphql_mutation/insert/views/nested_insert_article_author_simple_view.yaml +++ b/server/tests-py/queries/graphql_mutation/insert/views/nested_insert_article_author_simple_view.yaml @@ -4,6 +4,7 @@ status: 200 response: data: insert_article: + affected_rows: 4 returning: - author_simple: name: Author 1 @@ -17,9 +18,8 @@ response: content: Article content for article by author 2 id: 2 title: Article by author 2 - affected_rows: 4 query: - query: | + query: |- mutation article_author_simple{ insert_article( objects: [ diff --git a/server/tests-py/queries/graphql_mutation/update/basic/author_set_name.yaml b/server/tests-py/queries/graphql_mutation/update/basic/author_set_name.yaml index 69f7f913..3b06911a 100644 --- a/server/tests-py/queries/graphql_mutation/update/basic/author_set_name.yaml +++ b/server/tests-py/queries/graphql_mutation/update/basic/author_set_name.yaml @@ -2,12 +2,12 @@ description: Update mutation on author url: /v1/graphql response: data: - update_author: - affected_rows: 1 - returning: - - articles: [] - id: 1 - name: Jane + update_author: + affected_rows: 1 + returning: + - id: 1 + name: Jane + articles: [] status: 200 query: query: | diff --git a/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_array.yaml b/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_array.yaml index d450660b..49c54961 100644 --- a/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_array.yaml +++ b/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_array.yaml @@ -4,8 +4,10 @@ status: 200 response: data: update_person: + affected_rows: 1 returning: - - details: + - id: 2 + details: - address: country: Denmark city: Copenhagen @@ -15,8 +17,6 @@ response: - address: country: Australia city: Sydney - id: 2 - affected_rows: 1 query: variables: value: diff --git a/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_object.yaml b/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_object.yaml index 65fc2db5..bf6d2461 100644 --- a/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_object.yaml +++ b/server/tests-py/queries/graphql_mutation/update/jsonb/person_append_object.yaml @@ -6,15 +6,14 @@ response: update_person: affected_rows: 1 returning: - - details: - address: - city: Sydney - country: Australia + - id: 1 + details: name: - first: John last: Taylor - id: 1 - + first: John + address: + country: Australia + city: Sydney query: variables: value: diff --git a/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_array_element.yaml b/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_array_element.yaml index 7edcc5fd..bad19614 100644 --- a/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_array_element.yaml +++ b/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_array_element.yaml @@ -3,13 +3,13 @@ url: /v1/graphql response: data: update_person: + affected_rows: 1 returning: - - details: + - id: 2 + details: - address: country: United Kingdom city: Canterbury - id: 2 - affected_rows: 1 status: 200 query: query: | diff --git a/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_at_path.yaml b/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_at_path.yaml index 22db69a5..9642097b 100644 --- a/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_at_path.yaml +++ b/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_at_path.yaml @@ -4,12 +4,12 @@ status: 200 response: data: update_person: + affected_rows: 1 returning: - - details: + - id: 1 + details: name: first: John - id: 1 - affected_rows: 1 query: query: | mutation update_person($value: jsonb) { diff --git a/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_key.yaml b/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_key.yaml index 54340b14..f6a8124f 100644 --- a/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_key.yaml +++ b/server/tests-py/queries/graphql_mutation/update/jsonb/person_delete_key.yaml @@ -3,13 +3,13 @@ url: /v1/graphql response: data: update_person: - returning: - - details: - name: - first: Robert - last: Wilson - id: 3 affected_rows: 1 + returning: + - id: 3 + details: + name: + last: Wilson + first: Robert status: 200 query: query: | diff --git a/server/tests-py/queries/graphql_mutation/update/jsonb/person_prepend_array.yaml b/server/tests-py/queries/graphql_mutation/update/jsonb/person_prepend_array.yaml index bf9a1eb0..3ed182f3 100644 --- a/server/tests-py/queries/graphql_mutation/update/jsonb/person_prepend_array.yaml +++ b/server/tests-py/queries/graphql_mutation/update/jsonb/person_prepend_array.yaml @@ -3,8 +3,10 @@ url: /v1/graphql response: data: update_person: + affected_rows: 1 returning: - - details: + - id: 2 + details: - university: name: Sydney university - address: @@ -13,8 +15,6 @@ response: - address: country: United Kingdom city: Canterbury - id: 2 - affected_rows: 1 status: 200 query: variables: diff --git a/server/tests-py/queries/graphql_mutation/update/permissions/user_can_update_unpublished_article.yaml b/server/tests-py/queries/graphql_mutation/update/permissions/user_can_update_unpublished_article.yaml index a24717e7..668e98cf 100644 --- a/server/tests-py/queries/graphql_mutation/update/permissions/user_can_update_unpublished_article.yaml +++ b/server/tests-py/queries/graphql_mutation/update/permissions/user_can_update_unpublished_article.yaml @@ -3,16 +3,16 @@ url: /v1/graphql response: data: update_article: - returning: - - content: Article content version 1.0.2 - version: '1.0.2' - is_published: false - author: - name: Author 1 - id: 1 - id: 2 - title: Article 1 affected_rows: 1 + returning: + - id: 2 + version: 1.0.2 + title: Article 1 + content: Article content version 1.0.2 + author: + id: 1 + name: Author 1 + is_published: false headers: X-Hasura-Role: user X-Hasura-User-Id: '1' diff --git a/server/tests-py/queries/graphql_query/basic/nested_select_query_deep.yaml b/server/tests-py/queries/graphql_query/basic/nested_select_query_deep.yaml index 5b5c50ca..bc8814d4 100644 --- a/server/tests-py/queries/graphql_query/basic/nested_select_query_deep.yaml +++ b/server/tests-py/queries/graphql_query/basic/nested_select_query_deep.yaml @@ -3,18 +3,18 @@ url: /v1/graphql status: 200 response: data: - article: - - author: - articles: - - author: - articles: - - author: {id: 1} - id: 1 - id: 1 - id: 1 - id: 1 - id: 1 - + article: + - id: 1 + author: + id: 1 + articles: + - id: 1 + author: + id: 1 + articles: + - id: 1 + author: + id: 1 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/basic/nested_select_where_query_author_article.yaml b/server/tests-py/queries/graphql_query/basic/nested_select_where_query_author_article.yaml index 902dd9cc..c8db9571 100644 --- a/server/tests-py/queries/graphql_query/basic/nested_select_where_query_author_article.yaml +++ b/server/tests-py/queries/graphql_query/basic/nested_select_where_query_author_article.yaml @@ -7,11 +7,11 @@ response: - id: 1 name: Author 1 articles: - - title: Article 2 + - id: 2 + title: Article 2 content: Sample article content 2 - id: 2 query: - query: | + query: |- query { author (where: {name: {_eq: "Author 1"}}) { id @@ -20,7 +20,7 @@ query: where: {is_published: {_eq: true}} ) { id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/basic/select_query_author.yaml b/server/tests-py/queries/graphql_query/basic/select_query_author.yaml index 379f2d53..978f1ff9 100644 --- a/server/tests-py/queries/graphql_query/basic/select_query_author.yaml +++ b/server/tests-py/queries/graphql_query/basic/select_query_author.yaml @@ -4,10 +4,10 @@ status: 200 response: data: author: - - name: Author 1 - id: 1 - - name: Author 2 - id: 2 + - id: 1 + name: Author 1 + - id: 2 + name: Author 2 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/basic/select_query_author_by_pkey.yaml b/server/tests-py/queries/graphql_query/basic/select_query_author_by_pkey.yaml index a502e777..30a21e97 100644 --- a/server/tests-py/queries/graphql_query/basic/select_query_author_by_pkey.yaml +++ b/server/tests-py/queries/graphql_query/basic/select_query_author_by_pkey.yaml @@ -4,8 +4,8 @@ status: 200 response: data: author_by_pk: - name: Author 1 id: 1 + name: Author 1 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/basic/select_query_author_col_quoted.yaml b/server/tests-py/queries/graphql_query/basic/select_query_author_col_quoted.yaml index 8eabdbc8..9117cef9 100644 --- a/server/tests-py/queries/graphql_query/basic/select_query_author_col_quoted.yaml +++ b/server/tests-py/queries/graphql_query/basic/select_query_author_col_quoted.yaml @@ -4,12 +4,12 @@ status: 200 response: data: author: - - name: Author 1 - id: 1 - createdAt: '2017-09-21T09:39:44+00:00' - - name: Author 2 - id: 2 - createdAt: '2017-09-21T09:50:44+00:00' + - id: 1 + name: Author 1 + createdAt: '2017-09-21T09:39:44+00:00' + - id: 2 + name: Author 2 + createdAt: '2017-09-21T09:50:44+00:00' query: query: | query { diff --git a/server/tests-py/queries/graphql_query/basic/select_query_author_where.yaml b/server/tests-py/queries/graphql_query/basic/select_query_author_where.yaml index 7a5ee446..06b3488c 100644 --- a/server/tests-py/queries/graphql_query/basic/select_query_author_where.yaml +++ b/server/tests-py/queries/graphql_query/basic/select_query_author_where.yaml @@ -4,8 +4,8 @@ status: 200 response: data: author: - - name: Author 2 - id: 2 + - id: 2 + name: Author 2 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_article_author_not_published_or_not_registered.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_article_author_not_published_or_not_registered.yaml index f04b0b31..8cbfbb38 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_article_author_not_published_or_not_registered.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_article_author_not_published_or_not_registered.yaml @@ -4,35 +4,35 @@ status: 200 response: data: article: - - content: Sample article content 1 + - id: 1 + title: Article 1 + content: Sample article content 1 is_published: false author: + id: 1 name: Author 1 is_registered: true - id: 1 - id: 1 - title: Article 1 - - content: Sample article content 3 + - id: 3 + title: Article 3 + content: Sample article content 3 is_published: false author: + id: 2 name: Author 2 is_registered: true - id: 2 - id: 3 - title: Article 3 - - content: Sample article content 4 + - id: 4 + title: Article 4 + content: Sample article content 4 is_published: true author: + id: 3 name: Author 3 is_registered: false - id: 3 - id: 4 - title: Article 4 query: - query: | + query: |- query { article ( - where : {_or: + where : {_or: [ {is_published: {_eq: false}} {author: {is_registered: {_eq: false}}} diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gt.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gt.yaml index 6152be3c..148069cc 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gt.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gt.yaml @@ -4,21 +4,21 @@ status: 200 response: data: author: - - name: Author 3 + - id: 3 + name: Author 3 articles: - - content: Sample article content 4 - id: 4 + - id: 4 title: Article 4 - id: 3 + content: Sample article content 4 query: - query: | + query: |- query { author (where: {id: {_gt: 2}}) { id name articles { id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gte.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gte.yaml index 9c6459b2..7896019e 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gte.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_gte.yaml @@ -4,20 +4,20 @@ status: 200 response: data: author: - - name: Author 2 - id: 2 + - id: 2 + name: Author 2 articles: - - content: Sample article content 3 - id: 3 + - id: 3 title: Article 3 - - name: Author 3 - id: 3 + content: Sample article content 3 + - id: 3 + name: Author 3 articles: - - content: Sample article content 4 - id: 4 + - id: 4 title: Article 4 + content: Sample article content 4 query: - query: | + query: |- query { author ( where: {id: {_gte: 2}} @@ -26,7 +26,7 @@ query: name articles{ id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_in.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_in.yaml index 9a07afe5..00724465 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_in.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_in.yaml @@ -6,16 +6,16 @@ response: author: - name: Author 2 articles: - - content: Sample article content 3 - id: 3 + - id: 3 title: Article 3 + content: Sample article content 3 - name: Author 3 articles: - - content: Sample article content 4 - id: 4 + - id: 4 title: Article 4 + content: Sample article content 4 query: - query: | + query: |- query { author ( where: {name: {_in: [ "Author 2", "Author 3" ] }} @@ -23,7 +23,7 @@ query: name articles{ id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lt.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lt.yaml index 26d8319f..39fc451b 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lt.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lt.yaml @@ -4,17 +4,17 @@ status: 200 response: data: author: - - name: Author 1 - id: 1 + - id: 1 + name: Author 1 articles: - - content: Sample article content 1 - id: 1 + - id: 1 title: Article 1 - - content: Sample article content 2 - id: 2 + content: Sample article content 1 + - id: 2 title: Article 2 + content: Sample article content 2 query: - query: | + query: |- query { author ( where: {id: {_lt: 2}} @@ -23,7 +23,7 @@ query: name articles{ id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lte.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lte.yaml index ab7b9cd2..c9ebdc52 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lte.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_lte.yaml @@ -4,18 +4,18 @@ status: 200 response: data: author: - - name: Author 2 - id: 2 + - id: 2 + name: Author 2 articles: - - content: Sample article content 3 - id: 3 + - id: 3 title: Article 3 - - name: Author 1 - id: 1 + content: Sample article content 3 + - id: 1 + name: Author 1 articles: - - content: Sample article content 2 - id: 2 + - id: 2 title: Article 2 + content: Sample article content 2 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_neq.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_neq.yaml index 8aa5b753..2226e29e 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_neq.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_neq.yaml @@ -4,18 +4,18 @@ status: 200 response: data: author: - - name: Author 2 - id: 2 + - id: 2 + name: Author 2 articles: [] - - name: Author 3 - id: 3 + - id: 3 + name: Author 3 articles: - - content: Sample article content 4 - id: 4 + - id: 4 title: Article 4 + content: Sample article content 4 is_published: true query: - query: | + query: |- query { author (where: {name: {_neq: "Author 1"}}) { id @@ -24,7 +24,7 @@ query: where: {is_published: {_neq: false}} ) { id - title + title content is_published } diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_nin.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_nin.yaml index c3f45230..86e22f1f 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_nin.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_nin.yaml @@ -4,14 +4,14 @@ status: 200 response: data: author: - - name: Author 1 - id: 1 + - id: 1 + name: Author 1 articles: - - content: Sample article content 2 - id: 2 + - id: 2 title: Article 2 + content: Sample article content 2 query: - query: | + query: |- query { author ( where: {name: {_nin: [ "Author 2", "Author 3" ] }} @@ -22,7 +22,7 @@ query: where: { id : { _gt: 1}} ) { id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_not_lt.yaml b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_not_lt.yaml index d2868e94..4d8de968 100644 --- a/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_not_lt.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/basic/select_author_article_where_not_lt.yaml @@ -1,21 +1,21 @@ - description: Select author and their articles url: /v1/graphql status: 200 - response: &response + response: data: author: - - name: Author 2 - id: 2 + - id: 2 + name: Author 2 articles: - - content: Sample article content 3 - id: 3 + - id: 3 title: Article 3 - - name: Author 3 - id: 3 + content: Sample article content 3 + - id: 3 + name: Author 3 articles: - - content: Sample article content 4 - id: 4 + - id: 4 title: Article 4 + content: Sample article content 4 query: query: | query { @@ -26,7 +26,7 @@ name articles{ id - title + title content } } @@ -35,9 +35,22 @@ url: /v1/graphql status: 200 response: - <<: *response + data: + author: + - id: 2 + name: Author 2 + articles: + - id: 3 + title: Article 3 + content: Sample article content 3 + - id: 3 + name: Author 3 + articles: + - id: 4 + title: Article 4 + content: Sample article content 4 query: - query: | + query: |- query { author ( where: {id: {_gte: 2}} @@ -46,7 +59,7 @@ name articles{ id - title + title content } } diff --git a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_bestseller_latest.yaml b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_bestseller_latest.yaml index 99695bec..28e4bbf1 100644 --- a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_bestseller_latest.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_bestseller_latest.yaml @@ -4,23 +4,23 @@ status: 200 response: data: article: - - content: Sample article content 2 - author: - name: Author 1 - id: 1 - id: 2 + - id: 2 title: Article 2 + content: Sample article content 2 tags: - bestseller - latest - - content: Sample article content 3 author: - name: Author 2 - id: 2 - id: 3 + id: 1 + name: Author 1 + - id: 3 title: Article 3 + content: Sample article content 3 tags: - latest + author: + id: 2 + name: Author 2 query: variables: tags: diff --git a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_latest.yaml b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_latest.yaml index 3ef46e3a..4aaf4b74 100644 --- a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_latest.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contained_in_latest.yaml @@ -4,14 +4,14 @@ status: 200 response: data: article: - - content: Sample article content 3 - author: - name: Author 2 - id: 2 - id: 3 + - id: 3 title: Article 3 + content: Sample article content 3 tags: - latest + author: + id: 2 + name: Author 2 query: variables: tags: diff --git a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contains_latest.yaml b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contains_latest.yaml index c26e92cc..cab9c69b 100644 --- a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contains_latest.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_article_author_jsonb_contains_latest.yaml @@ -4,23 +4,23 @@ status: 200 response: data: article: - - content: Sample article content 2 - author: - name: Author 1 - id: 1 - id: 2 + - id: 2 title: Article 2 + content: Sample article content 2 tags: - bestseller - latest - - content: Sample article content 3 author: - name: Author 2 - id: 2 - id: 3 + id: 1 + name: Author 1 + - id: 3 title: Article 3 + content: Sample article content 3 tags: - latest + author: + id: 2 + name: Author 2 query: query: | query ($tags: jsonb) { diff --git a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_author_article_jsonb_contains_bestseller.yaml b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_author_article_jsonb_contains_bestseller.yaml index 7e137075..daf57863 100644 --- a/server/tests-py/queries/graphql_query/boolexp/jsonb/select_author_article_jsonb_contains_bestseller.yaml +++ b/server/tests-py/queries/graphql_query/boolexp/jsonb/select_author_article_jsonb_contains_bestseller.yaml @@ -4,12 +4,12 @@ status: 200 response: data: author: - - name: Author 1 - id: 1 + - id: 1 + name: Author 1 articles: - - content: Sample article content 2 - id: 2 + - id: 2 title: Article 2 + content: Sample article content 2 tags: - bestseller - latest diff --git a/server/tests-py/queries/graphql_query/limits/select_query_article_limit_1.yaml b/server/tests-py/queries/graphql_query/limits/select_query_article_limit_1.yaml index 672c5991..ef343c40 100644 --- a/server/tests-py/queries/graphql_query/limits/select_query_article_limit_1.yaml +++ b/server/tests-py/queries/graphql_query/limits/select_query_article_limit_1.yaml @@ -8,8 +8,8 @@ response: title: Article 3 content: Sample article content 3 author: - name: Author 2 id: 2 + name: Author 2 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/limits/select_query_article_limit_2.yaml b/server/tests-py/queries/graphql_query/limits/select_query_article_limit_2.yaml index 9c0d0d96..9b150c31 100644 --- a/server/tests-py/queries/graphql_query/limits/select_query_article_limit_2.yaml +++ b/server/tests-py/queries/graphql_query/limits/select_query_article_limit_2.yaml @@ -8,14 +8,14 @@ response: title: Article 3 content: Sample article content 3 author: - name: Author 2 id: 2 + name: Author 2 - id: 2 title: Article 2 content: Sample article content 2 author: - name: Author 1 id: 1 + name: Author 1 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/offset/select_query_article_offset_1_limit_2.yaml b/server/tests-py/queries/graphql_query/offset/select_query_article_offset_1_limit_2.yaml index af58e821..c1e1dcfc 100644 --- a/server/tests-py/queries/graphql_query/offset/select_query_article_offset_1_limit_2.yaml +++ b/server/tests-py/queries/graphql_query/offset/select_query_article_offset_1_limit_2.yaml @@ -8,14 +8,14 @@ response: title: Article 2 content: Sample article content 2 author: - name: Author 1 id: 1 + name: Author 1 - id: 1 title: Article 1 content: Sample article content 1 author: - name: Author 1 id: 1 + name: Author 1 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/offset/select_query_article_offset_2_limit_1.yaml b/server/tests-py/queries/graphql_query/offset/select_query_article_offset_2_limit_1.yaml index af5ef51c..be09c96b 100644 --- a/server/tests-py/queries/graphql_query/offset/select_query_article_offset_2_limit_1.yaml +++ b/server/tests-py/queries/graphql_query/offset/select_query_article_offset_2_limit_1.yaml @@ -8,8 +8,8 @@ response: title: Article 1 content: Sample article content 1 author: - name: Author 1 id: 1 + name: Author 1 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/offset/select_query_article_string_offset.yaml b/server/tests-py/queries/graphql_query/offset/select_query_article_string_offset.yaml index ac7e0f3d..684fba0d 100644 --- a/server/tests-py/queries/graphql_query/offset/select_query_article_string_offset.yaml +++ b/server/tests-py/queries/graphql_query/offset/select_query_article_string_offset.yaml @@ -8,8 +8,8 @@ response: title: Article 2 content: Sample article content 2 author: - name: Author 1 id: 1 + name: Author 1 query: query: | query { diff --git a/server/tests-py/queries/graphql_query/permissions/user_cannot_access_remarks_col.yaml b/server/tests-py/queries/graphql_query/permissions/user_cannot_access_remarks_col.yaml index 875e11f2..94a1c102 100644 --- a/server/tests-py/queries/graphql_query/permissions/user_cannot_access_remarks_col.yaml +++ b/server/tests-py/queries/graphql_query/permissions/user_cannot_access_remarks_col.yaml @@ -25,14 +25,14 @@ response: data: author: - - name: Author 1 - id: 1 + - id: 1 + name: Author 1 remarks_internal: remark 1 - - name: Author 2 - id: 2 + - id: 2 + name: Author 2 remarks_internal: remark 2 - - name: Author 3 - id: 3 + - id: 3 + name: Author 3 remarks_internal: remark 3 query: query: | diff --git a/server/tests-py/queries/remote_schemas/simple2_mutation.yaml b/server/tests-py/queries/remote_schemas/simple2_mutation.yaml index 83e3112a..49b7c775 100644 --- a/server/tests-py/queries/remote_schemas/simple2_mutation.yaml +++ b/server/tests-py/queries/remote_schemas/simple2_mutation.yaml @@ -5,8 +5,8 @@ response: data: createUser: user: - username: foobar id: 123 + username: foobar query: query: | mutation { diff --git a/server/tests-py/queries/remote_schemas/simple2_query.yaml b/server/tests-py/queries/remote_schemas/simple2_query.yaml index e6d57ded..8e35949e 100644 --- a/server/tests-py/queries/remote_schemas/simple2_query.yaml +++ b/server/tests-py/queries/remote_schemas/simple2_query.yaml @@ -4,8 +4,8 @@ status: 200 response: data: user: - username: john id: 2 + username: john query: query: | query { diff --git a/server/tests-py/test_graphql_mutations.py b/server/tests-py/test_graphql_mutations.py index 193e3635..67ba951a 100644 --- a/server/tests-py/test_graphql_mutations.py +++ b/server/tests-py/test_graphql_mutations.py @@ -221,6 +221,7 @@ class TestGraphqlInsertGeoJson(DefaultTestMutations): @pytest.mark.parametrize("transport", ['http', 'websocket']) class TestGraphqlNestedInserts(DefaultTestMutations): + @pytest.mark.xfail(reason="Incorrect ordering. Refer https://github.com/hasura/graphql-engine/issues/3271") def test_author_with_articles(self, hge_ctx, transport): check_query_f(hge_ctx, self.dir() + "/author_with_articles.yaml") @@ -233,6 +234,7 @@ class TestGraphqlNestedInserts(DefaultTestMutations): def test_author_with_articles_author_id_fail(self, hge_ctx, transport): check_query_f(hge_ctx, self.dir() + "/author_with_articles_author_id_fail.yaml") + @pytest.mark.xfail(reason="Incorrect ordering. Refer https://github.com/hasura/graphql-engine/issues/3271") def test_articles_with_author(self, hge_ctx, transport): check_query_f(hge_ctx, self.dir() + "/articles_with_author.yaml")