Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to check that genqlient handles covariance #203

Merged
merged 1 commit into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
query CovariantInterfaceImplementation {
randomItem {
id
next { ...ContentFields }
related { ...ContentFields }
}
root {
...ContentFields
...TopicFields
next { ...TopicFields }
related { ...TopicFields }
}
}

fragment ContentFields on Content {
next { id }
related { id }
}

fragment TopicFields on Topic {
next { id }
related { id }
}
8 changes: 8 additions & 0 deletions generate/testdata/queries/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ interface Content {
name: String!
parent: Topic
url: String!
next: Content
related: [Content!]
}

"""An object with a duration, like a video."""
Expand All @@ -102,6 +104,8 @@ type Article implements Content {
url: String!
text: String!
thumbnail: StuffThumbnail
next: Content
related: [Content!]
}

type StuffThumbnail { # for articles, but let's give the name-generator a hard time.
Expand All @@ -117,6 +121,8 @@ type Video implements Content & HasDuration {
url: String!
duration: Int!
thumbnail: Thumbnail
next: Content
related: [Content!]
}

type Thumbnail { # for videos, but let's give the name-generator a hard time.
Expand All @@ -133,6 +139,8 @@ type Topic implements Content {
children: [Content!]!
videoChildren: [Video!]!
schoolGrade: String
next: Topic
related: [Topic!]
}

input RecursiveInput {
Expand Down
Loading