This file contains hidden or 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
| type MagicalCreature struct { | |
| schemabuilder.Interface | |
| *Spider | |
| *Snake | |
| } | |
| func (s *Server) RegisterInterface(sb *schemabuilder.Schema) { | |
| sb.Query().FieldFunc("magicalCreature", func(ctx context.Context, args struct { | |
| Id schemabuilder.ID | |
| }) *MagicalCreature { |
This file contains hidden or 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
| type MagicalObject struct { | |
| schemabuilder.Union | |
| *Wand | |
| *Broomstick | |
| } | |
| func (s *Server) RegisterUnion(sb *schemabuilder.Schema) { | |
| sb.Query().FieldFunc("magicalObject", func(ctx context.Context, args struct { | |
| Id schemabuilder.ID | |
| }) *MagicalObject { |
This file contains hidden or 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
| func main() { | |
| s := &Server{ | |
| Wands: []*Wand{}, | |
| Broomsticks: []*Broomstick{}, | |
| Snakes: []*Snake{}, | |
| Spiders: []*Spider{}, | |
| } | |
| sb := schemabuilder.NewSchema() | |
| RegisterWand(sb) |
This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| "github.com/google/uuid" | |
| "log" | |
| "net/http" | |
| "go.appointy.com/jaal" | |
| "go.appointy.com/jaal/introspection" |
OlderNewer