Skip to content

Commit

Permalink
Allow fields that return root level definitions (#2858)
Browse files Browse the repository at this point in the history
* generate structs for root level definitions to support fields that return Query, Mutation or Subscription

* removed unnecessary comment

* re-ran go generate

---------

Co-authored-by: Te'Andre Smith <[email protected]>
  • Loading branch information
teandresmith and teandre-smith authored Dec 11, 2023
1 parent 682a58d commit 42f6e39
Show file tree
Hide file tree
Showing 53 changed files with 865 additions and 189 deletions.
130 changes: 124 additions & 6 deletions _examples/chat/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 14 additions & 4 deletions _examples/chat/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion _examples/chat/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
type Chatroom {
name: String!
messages: [Message!]!
subscription: Subscription!
}

type Message {
id: ID!
text: String!
createdBy: String!
createdAt: Time!
subscription: Subscription!
}

type Query {
room(name:String!): Chatroom
room(name: String!): Chatroom
}

type Mutation {
Expand Down
1 change: 1 addition & 0 deletions _examples/chat/src/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="react-scripts" />
Loading

0 comments on commit 42f6e39

Please sign in to comment.