-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
300 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
31 changes: 31 additions & 0 deletions
31
...ests/src/tests/snapshots/integration_tests__tests__basic__selects_array_within_array.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
source: crates/integration-tests/src/tests/basic.rs | ||
expression: "graphql_query(r#\"\n query {\n artistsWithAlbumsAndTracks(limit: 1, order_by: {id: Asc}) {\n name\n albums {\n title\n tracks {\n name\n }\n }\n }\n }\n \"#).run().await?" | ||
--- | ||
data: | ||
artistsWithAlbumsAndTracks: | ||
- name: AC/DC | ||
albums: | ||
- title: For Those About To Rock We Salute You | ||
tracks: | ||
- name: "Let's Get It Up" | ||
- name: Inject The Venom | ||
- name: Evil Walks | ||
- name: Snowballed | ||
- name: Breaking The Rules | ||
- name: Spellbound | ||
- name: Night Of The Long Knives | ||
- name: Put The Finger On You | ||
- name: For Those About To Rock (We Salute You) | ||
- name: C.O.D. | ||
- title: Let There Be Rock | ||
tracks: | ||
- name: Go Down | ||
- name: Bad Boy Boogie | ||
- name: Problem Child | ||
- name: Dog Eat Dog | ||
- name: Let There Be Rock | ||
- name: Overdose | ||
- name: "Hell Ain't A Bad Place To Be" | ||
- name: Whole Lotta Rosie | ||
errors: ~ |
59 changes: 59 additions & 0 deletions
59
fixtures/hasura/chinook/connector/chinook/native_queries/artists_with_albums_and_tracks.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"name": "artists_with_albums_and_tracks", | ||
"representation": "collection", | ||
"inputCollection": "Artist", | ||
"description": "combines artist, albums, and tracks into a single document per artist", | ||
"resultDocumentType": "ArtistWithAlbumsAndTracks", | ||
"objectTypes": { | ||
"ArtistWithAlbumsAndTracks": { | ||
"fields": { | ||
"_id": { "type": { "scalar": "objectId" } }, | ||
"Name": { "type": { "scalar": "string" } }, | ||
"Albums": { "type": { "arrayOf": { "object": "AlbumWithTracks" } } } | ||
} | ||
}, | ||
"AlbumWithTracks": { | ||
"fields": { | ||
"_id": { "type": { "scalar": "objectId" } }, | ||
"Title": { "type": { "scalar": "string" } }, | ||
"Tracks": { "type": { "arrayOf": { "object": "Track" } } } | ||
} | ||
} | ||
}, | ||
"pipeline": [ | ||
{ | ||
"$lookup": { | ||
"from": "Album", | ||
"localField": "ArtistId", | ||
"foreignField": "ArtistId", | ||
"as": "Albums", | ||
"pipeline": [ | ||
{ | ||
"$lookup": { | ||
"from": "Track", | ||
"localField": "AlbumId", | ||
"foreignField": "AlbumId", | ||
"as": "Tracks" | ||
} | ||
}, | ||
{ | ||
"$replaceWith": { | ||
"_id": "$_id", | ||
"Title": "$Title", | ||
"Tracks": "$Tracks" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"$replaceWith": { | ||
"_id": "$_id", | ||
"Name": "$Name", | ||
"Albums": "$Albums" | ||
} | ||
} | ||
] | ||
} | ||
|
||
|
145 changes: 145 additions & 0 deletions
145
fixtures/hasura/chinook/metadata/ArtistsWithAlbumsAndTracks.hml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
--- | ||
kind: ObjectType | ||
version: v1 | ||
definition: | ||
name: AlbumWithTracks | ||
fields: | ||
- name: id | ||
type: Chinook_ObjectId! | ||
- name: title | ||
type: String! | ||
- name: tracks | ||
type: "[Track!]!" | ||
graphql: | ||
typeName: Chinook_AlbumWithTracks | ||
inputTypeName: Chinook_AlbumWithTracksInput | ||
dataConnectorTypeMapping: | ||
- dataConnectorName: chinook | ||
dataConnectorObjectType: AlbumWithTracks | ||
fieldMapping: | ||
id: | ||
column: | ||
name: _id | ||
title: | ||
column: | ||
name: Title | ||
tracks: | ||
column: | ||
name: Tracks | ||
|
||
--- | ||
kind: TypePermissions | ||
version: v1 | ||
definition: | ||
typeName: AlbumWithTracks | ||
permissions: | ||
- role: admin | ||
output: | ||
allowedFields: | ||
- id | ||
- title | ||
- tracks | ||
|
||
--- | ||
kind: ObjectType | ||
version: v1 | ||
definition: | ||
name: ArtistWithAlbumsAndTracks | ||
fields: | ||
- name: id | ||
type: Chinook_ObjectId! | ||
- name: albums | ||
type: "[AlbumWithTracks!]!" | ||
- name: name | ||
type: String! | ||
graphql: | ||
typeName: Chinook_ArtistWithAlbumsAndTracks | ||
inputTypeName: Chinook_ArtistWithAlbumsAndTracksInput | ||
dataConnectorTypeMapping: | ||
- dataConnectorName: chinook | ||
dataConnectorObjectType: ArtistWithAlbumsAndTracks | ||
fieldMapping: | ||
id: | ||
column: | ||
name: _id | ||
albums: | ||
column: | ||
name: Albums | ||
name: | ||
column: | ||
name: Name | ||
|
||
--- | ||
kind: TypePermissions | ||
version: v1 | ||
definition: | ||
typeName: ArtistWithAlbumsAndTracks | ||
permissions: | ||
- role: admin | ||
output: | ||
allowedFields: | ||
- id | ||
- albums | ||
- name | ||
|
||
--- | ||
kind: ObjectBooleanExpressionType | ||
version: v1 | ||
definition: | ||
name: ArtistWithAlbumsAndTracksBoolExp | ||
objectType: ArtistWithAlbumsAndTracks | ||
dataConnectorName: chinook | ||
dataConnectorObjectType: ArtistWithAlbumsAndTracks | ||
comparableFields: | ||
- fieldName: id | ||
operators: | ||
enableAll: true | ||
- fieldName: albums | ||
operators: | ||
enableAll: true | ||
- fieldName: name | ||
operators: | ||
enableAll: true | ||
graphql: | ||
typeName: Chinook_ArtistWithAlbumsAndTracksBoolExp | ||
|
||
--- | ||
kind: Model | ||
version: v1 | ||
definition: | ||
name: ArtistsWithAlbumsAndTracks | ||
objectType: ArtistWithAlbumsAndTracks | ||
source: | ||
dataConnectorName: chinook | ||
collection: artists_with_albums_and_tracks | ||
filterExpressionType: ArtistWithAlbumsAndTracksBoolExp | ||
orderableFields: | ||
- fieldName: id | ||
orderByDirections: | ||
enableAll: true | ||
- fieldName: albums | ||
orderByDirections: | ||
enableAll: true | ||
- fieldName: name | ||
orderByDirections: | ||
enableAll: true | ||
graphql: | ||
selectMany: | ||
queryRootField: artistsWithAlbumsAndTracks | ||
selectUniques: | ||
- queryRootField: artistsWithAlbumsAndTracksById | ||
uniqueIdentifier: | ||
- id | ||
orderByExpressionType: Chinook_ArtistsWithAlbumsAndTracksOrderBy | ||
description: combines artist, albums, and tracks into a single document per artist | ||
|
||
--- | ||
kind: ModelPermissions | ||
version: v1 | ||
definition: | ||
modelName: ArtistsWithAlbumsAndTracks | ||
permissions: | ||
- role: admin | ||
select: | ||
filter: null | ||
|
This file contains 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