diff --git a/graphql/.env.template b/graphql/.env.template deleted file mode 100644 index 7df6ddd6..00000000 --- a/graphql/.env.template +++ /dev/null @@ -1,2 +0,0 @@ -MONGODB_URI= -#PORT= \ No newline at end of file diff --git a/graphql/go.mod b/graphql/go.mod deleted file mode 100644 index b5ea904b..00000000 --- a/graphql/go.mod +++ /dev/null @@ -1,36 +0,0 @@ -module github.com/LocatingWizard/nebula_api_graphql - -go 1.20 - -require ( - github.com/99designs/gqlgen v0.17.27 - github.com/joho/godotenv v1.5.1 - github.com/vektah/gqlparser/v2 v2.5.15 - go.mongodb.org/mongo-driver v1.11.3 -) - -require ( - github.com/agnivade/levenshtein v1.1.1 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/golang/snappy v0.0.1 // indirect - github.com/gorilla/websocket v1.5.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect - github.com/klauspost/compress v1.13.6 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/urfave/cli/v2 v2.24.4 // indirect - github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.1.1 // indirect - github.com/xdg-go/stringprep v1.0.3 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/mod v0.8.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.6.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/graphql/go.sum b/graphql/go.sum deleted file mode 100644 index 1f34e9a9..00000000 --- a/graphql/go.sum +++ /dev/null @@ -1,94 +0,0 @@ -github.com/99designs/gqlgen v0.17.27 h1:XPsaZiWY1lL2qqVYtBt37GzkyX7bBiVvda7k1buC/Ao= -github.com/99designs/gqlgen v0.17.27/go.mod h1:i4rEatMrzzu6RXaHydq1nmEPZkb3bKQsnxNRHS4DQB4= -github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8= -github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= -github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= -github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= -github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= -github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/urfave/cli/v2 v2.24.4 h1:0gyJJEBYtCV87zI/x2nZCPyDxD51K6xM8SkwjHFCNEU= -github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= -github.com/vektah/gqlparser/v2 v2.5.15 h1:fYdnU8roQniJziV5TDiFPm/Ff7pE8xbVSOJqbsdl88A= -github.com/vektah/gqlparser/v2 v2.5.15/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w= -github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y= -go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/graphql/gqlgen.yml b/graphql/gqlgen.yml deleted file mode 100644 index eb991a34..00000000 --- a/graphql/gqlgen.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Where are all the schema files located? globs are supported eg src/**/*.graphqls -schema: - - graph/schema/*.graphqls - -# Where should the generated server code go? -exec: - filename: graph/generated.go - package: graph - -# Uncomment to enable federation -# federation: -# filename: graph/federation.go -# package: graph - -# Where should any generated models go? -model: - filename: graph/model/models_gen.go - package: model - -# Where should the resolver implementations go? -resolver: - layout: follow-schema - dir: graph - package: graph - -# Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models -# struct_tag: json - -# Optional: turn on to use []Thing instead of []*Thing -# omit_slice_element_pointers: false - -# Optional: turn off to make struct-type struct fields not use pointers -# e.g. type Thing struct { FieldA OtherThing } instead of { FieldA *OtherThing } -# struct_fields_always_pointers: true - -# Optional: turn off to make resolvers return values instead of pointers for structs -# resolvers_always_return_pointers: true - -# Optional: set to speed up generation time by not performing a final validation pass. -# skip_validation: true - -# gqlgen will search for any type names in the schema in these go packages -# if they match it will use them, otherwise it will generate them. -autobind: - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" - -# This section declares type mapping between the GraphQL and go type systems -# -# The first line in each type will be used as defaults for resolver arguments and -# modelgen, the others will be allowed when binding to fields. Configure them to -# your liking -models: - ID: - model: - - github.com/99designs/gqlgen/graphql.ID - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 - Int: - model: - - github.com/99designs/gqlgen/graphql.Int - - github.com/99designs/gqlgen/graphql.Int64 - - github.com/99designs/gqlgen/graphql.Int32 diff --git a/graphql/graph/course.resolvers.go b/graphql/graph/course.resolvers.go deleted file mode 100644 index d4b4bc85..00000000 --- a/graphql/graph/course.resolvers.go +++ /dev/null @@ -1,30 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.27 - -import ( - "context" - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" -) - -// Sections is the resolver for the sections field. -func (r *courseResolver) Sections(ctx context.Context, obj *model.Course) ([]*model.Section, error) { - var out []*model.Section - section_ids := obj.Sections - for _, id := range section_ids { - section, err := r.Query().SectionByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - out = append(out, section) - } - return out, nil -} - -// Course returns CourseResolver implementation. -func (r *Resolver) Course() CourseResolver { return &courseResolver{r} } - -type courseResolver struct{ *Resolver } diff --git a/graphql/graph/exam.resolvers.go b/graphql/graph/exam.resolvers.go deleted file mode 100644 index 87f346a5..00000000 --- a/graphql/graph/exam.resolvers.go +++ /dev/null @@ -1,115 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.27 - -import ( - "context" - "fmt" - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/bson/bsontype" -) - -// Requirement is the resolver for the requirement field. -func (r *possibleOutcomesResolver) Requirement(ctx context.Context, obj *model.PossibleOutcomes) (model.Requirement, error) { - bytes, err := bson.Marshal(obj.Requirement) - if err != nil { - return nil, err - } - - requirementType := obj.Requirement.Lookup("type").StringValue() - - switch requirementType { - case "course": - var t model.CourseRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "section": - var t model.SectionRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "exam": - var t model.ExamRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "major": - var t model.MajorRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "minor": - var t model.MinorRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "gpa": - var t model.GPARequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "consent": - var t model.ConsentRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "collection": - var t model.CollectionRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "hours": - var t model.HoursRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "other": - var t model.OtherRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "choice": - var t model.ChoiceRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "limit": - var t model.LimitRequirement - bson.Unmarshal(bytes, &t) - return t, nil - case "core": - var t model.CoreRequirement - bson.Unmarshal(bytes, &t) - return t, nil - default: - return nil, fmt.Errorf("unkown requirement type: %v", err) - } -} - -// PossibleOutcomes is the resolver for the possible_outcomes field. -func (r *possibleOutcomesResolver) PossibleOutcomes(ctx context.Context, obj *model.PossibleOutcomes) ([][]model.Outcome, error) { - var out [][]model.Outcome - for _, v := range obj.PossibleOutcomes { - var temp []model.Outcome - vals, err := v.Values() - if err != nil { - return nil, err - } - for _, w := range vals { - itemType := w.Type - if itemType == bsontype.ObjectID { - id := w.ObjectID() - course, err := r.Query().CourseByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - temp = append(temp, course) - } else if itemType == bsontype.EmbeddedDocument { - var t model.Credit - bson.Unmarshal(w.Value, &t) - temp = append(temp, t) - } - } - out = append(out, temp) - } - return out, nil -} - -// PossibleOutcomes returns PossibleOutcomesResolver implementation. -func (r *Resolver) PossibleOutcomes() PossibleOutcomesResolver { return &possibleOutcomesResolver{r} } - -type possibleOutcomesResolver struct{ *Resolver } diff --git a/graphql/graph/generated.go b/graphql/graph/generated.go deleted file mode 100644 index e18cf56f..00000000 --- a/graphql/graph/generated.go +++ /dev/null @@ -1,12386 +0,0 @@ -// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. - -package graph - -import ( - "bytes" - "context" - "embed" - "errors" - "fmt" - "strconv" - "sync" - "sync/atomic" - - "github.com/99designs/gqlgen/graphql" - "github.com/99designs/gqlgen/graphql/introspection" - "github.com/LocatingWizard/nebula_api_graphql/graph/model" - gqlparser "github.com/vektah/gqlparser/v2" - "github.com/vektah/gqlparser/v2/ast" -) - -// region ************************** generated!.gotpl ************************** - -// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. -func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { - return &executableSchema{ - resolvers: cfg.Resolvers, - directives: cfg.Directives, - complexity: cfg.Complexity, - } -} - -type Config struct { - Resolvers ResolverRoot - Directives DirectiveRoot - Complexity ComplexityRoot -} - -type ResolverRoot interface { - CollectionRequirement() CollectionRequirementResolver - Course() CourseResolver - CourseRequirement() CourseRequirementResolver - ExamRequirement() ExamRequirementResolver - PossibleOutcomes() PossibleOutcomesResolver - Professor() ProfessorResolver - Query() QueryResolver - Section() SectionResolver -} - -type DirectiveRoot struct { -} - -type ComplexityRoot struct { - ALEKSExam struct { - ID func(childComplexity int) int - Placement func(childComplexity int) int - } - - APExam struct { - ID func(childComplexity int) int - Name func(childComplexity int) int - Yields func(childComplexity int) int - } - - AcademicSession struct { - EndDate func(childComplexity int) int - Name func(childComplexity int) int - StartDate func(childComplexity int) int - } - - Assistant struct { - Email func(childComplexity int) int - FirstName func(childComplexity int) int - LastName func(childComplexity int) int - Role func(childComplexity int) int - } - - Attributes struct { - RawAttributes func(childComplexity int) int - } - - CLEPExam struct { - ID func(childComplexity int) int - Name func(childComplexity int) int - Yields func(childComplexity int) int - } - - CSPlacementExam struct { - ID func(childComplexity int) int - Yields func(childComplexity int) int - } - - ChoiceRequirement struct { - Choices func(childComplexity int) int - } - - CollectionRequirement struct { - Name func(childComplexity int) int - Options func(childComplexity int) int - Required func(childComplexity int) int - } - - ConsentRequirement struct { - Granter func(childComplexity int) int - } - - CoreRequirement struct { - CoreFlag func(childComplexity int) int - Hours func(childComplexity int) int - } - - Course struct { - ActivityType func(childComplexity int) int - CatalogYear func(childComplexity int) int - ClassLevel func(childComplexity int) int - CoOrPreRequisites func(childComplexity int) int - Corequisites func(childComplexity int) int - CourseNumber func(childComplexity int) int - CreditHours func(childComplexity int) int - Description func(childComplexity int) int - EnrollmentReqs func(childComplexity int) int - Grading func(childComplexity int) int - ID func(childComplexity int) int - InternalCourseNumber func(childComplexity int) int - LaboratoryContactHours func(childComplexity int) int - LectureContactHours func(childComplexity int) int - OfferingFrequency func(childComplexity int) int - Prerequisites func(childComplexity int) int - School func(childComplexity int) int - Sections func(childComplexity int) int - SubjectPrefix func(childComplexity int) int - Title func(childComplexity int) int - } - - CourseRequirement struct { - ClassReference func(childComplexity int) int - MinimumGrade func(childComplexity int) int - } - - Credit struct { - Category func(childComplexity int) int - CreditHours func(childComplexity int) int - } - - ExamRequirement struct { - ExamReference func(childComplexity int) int - MinimumScore func(childComplexity int) int - } - - GPARequirement struct { - Minimum func(childComplexity int) int - Subset func(childComplexity int) int - } - - HoursRequirement struct { - Options func(childComplexity int) int - Required func(childComplexity int) int - } - - IBExam struct { - ID func(childComplexity int) int - Level func(childComplexity int) int - Name func(childComplexity int) int - Yields func(childComplexity int) int - } - - LimitRequirement struct { - MaxHours func(childComplexity int) int - } - - Location struct { - Building func(childComplexity int) int - MapURI func(childComplexity int) int - Room func(childComplexity int) int - } - - MajorRequirement struct { - Major func(childComplexity int) int - } - - Meeting struct { - EndDate func(childComplexity int) int - EndTime func(childComplexity int) int - Location func(childComplexity int) int - MeetingDays func(childComplexity int) int - Modality func(childComplexity int) int - StartDate func(childComplexity int) int - StartTime func(childComplexity int) int - } - - MinorRequirement struct { - Minor func(childComplexity int) int - } - - OtherRequirement struct { - Condition func(childComplexity int) int - Description func(childComplexity int) int - } - - PossibleOutcomes struct { - PossibleOutcomes func(childComplexity int) int - Requirement func(childComplexity int) int - } - - Professor struct { - Email func(childComplexity int) int - FirstName func(childComplexity int) int - ID func(childComplexity int) int - ImageURI func(childComplexity int) int - LastName func(childComplexity int) int - Office func(childComplexity int) int - OfficeHours func(childComplexity int) int - PhoneNumber func(childComplexity int) int - ProfileURI func(childComplexity int) int - Sections func(childComplexity int) int - Titles func(childComplexity int) int - } - - Query struct { - Course func(childComplexity int, courseNumber *string, subjectPrefix *string, title *string, description *string, school *string, creditHours *string, classLevel *string, activityType *string, grading *string, internalCourseNumber *string, lectureContactHours *string, offeringFrequency *string) int - CourseByID func(childComplexity int, id string) int - Exam func(childComplexity int, typeArg *string, name *string, level *string) int - ExamByID func(childComplexity int, id string) int - Professor func(childComplexity int, firstName *string, lastName *string, titles []string, email *string, phoneNumber *string, profileURI *string, imageURI *string) int - ProfessorByID func(childComplexity int, id string) int - Section func(childComplexity int, sectionNumber *string, courseReference *string, internalClassNumber *string, instructionMode *string, syllabusURI *string) int - SectionByID func(childComplexity int, id string) int - } - - Section struct { - AcademicSession func(childComplexity int) int - Attributes func(childComplexity int) int - CoreFlags func(childComplexity int) int - CourseReference func(childComplexity int) int - GradeDistribution func(childComplexity int) int - ID func(childComplexity int) int - InstructionMode func(childComplexity int) int - InternalClassNumber func(childComplexity int) int - Meetings func(childComplexity int) int - Professors func(childComplexity int) int - SectionCorequisites func(childComplexity int) int - SectionNumber func(childComplexity int) int - SyllabusURI func(childComplexity int) int - TeachingAssistants func(childComplexity int) int - } - - SectionRequirement struct { - SectionReference func(childComplexity int) int - } -} - -type CollectionRequirementResolver interface { - Options(ctx context.Context, obj *model.CollectionRequirement) ([]model.Requirement, error) -} -type CourseResolver interface { - Sections(ctx context.Context, obj *model.Course) ([]*model.Section, error) -} -type CourseRequirementResolver interface { - ClassReference(ctx context.Context, obj *model.CourseRequirement) (*model.Course, error) -} -type ExamRequirementResolver interface { - ExamReference(ctx context.Context, obj *model.ExamRequirement) (model.Exam, error) -} -type PossibleOutcomesResolver interface { - Requirement(ctx context.Context, obj *model.PossibleOutcomes) (model.Requirement, error) - PossibleOutcomes(ctx context.Context, obj *model.PossibleOutcomes) ([][]model.Outcome, error) -} -type ProfessorResolver interface { - Sections(ctx context.Context, obj *model.Professor) ([]*model.Section, error) -} -type QueryResolver interface { - CourseByID(ctx context.Context, id string) (*model.Course, error) - Course(ctx context.Context, courseNumber *string, subjectPrefix *string, title *string, description *string, school *string, creditHours *string, classLevel *string, activityType *string, grading *string, internalCourseNumber *string, lectureContactHours *string, offeringFrequency *string) ([]*model.Course, error) - SectionByID(ctx context.Context, id string) (*model.Section, error) - Section(ctx context.Context, sectionNumber *string, courseReference *string, internalClassNumber *string, instructionMode *string, syllabusURI *string) ([]*model.Section, error) - ProfessorByID(ctx context.Context, id string) (*model.Professor, error) - Professor(ctx context.Context, firstName *string, lastName *string, titles []string, email *string, phoneNumber *string, profileURI *string, imageURI *string) ([]*model.Professor, error) - ExamByID(ctx context.Context, id string) (model.Exam, error) - Exam(ctx context.Context, typeArg *string, name *string, level *string) ([]model.Exam, error) -} -type SectionResolver interface { - CourseReference(ctx context.Context, obj *model.Section) (*model.Course, error) - - Professors(ctx context.Context, obj *model.Section) ([]*model.Professor, error) -} - -type executableSchema struct { - resolvers ResolverRoot - directives DirectiveRoot - complexity ComplexityRoot -} - -func (e *executableSchema) Schema() *ast.Schema { - return parsedSchema -} - -func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { - ec := executionContext{nil, e} - _ = ec - switch typeName + "." + field { - - case "ALEKSExam._id": - if e.complexity.ALEKSExam.ID == nil { - break - } - - return e.complexity.ALEKSExam.ID(childComplexity), true - - case "ALEKSExam.placement": - if e.complexity.ALEKSExam.Placement == nil { - break - } - - return e.complexity.ALEKSExam.Placement(childComplexity), true - - case "APExam._id": - if e.complexity.APExam.ID == nil { - break - } - - return e.complexity.APExam.ID(childComplexity), true - - case "APExam.name": - if e.complexity.APExam.Name == nil { - break - } - - return e.complexity.APExam.Name(childComplexity), true - - case "APExam.yields": - if e.complexity.APExam.Yields == nil { - break - } - - return e.complexity.APExam.Yields(childComplexity), true - - case "AcademicSession.end_date": - if e.complexity.AcademicSession.EndDate == nil { - break - } - - return e.complexity.AcademicSession.EndDate(childComplexity), true - - case "AcademicSession.name": - if e.complexity.AcademicSession.Name == nil { - break - } - - return e.complexity.AcademicSession.Name(childComplexity), true - - case "AcademicSession.start_date": - if e.complexity.AcademicSession.StartDate == nil { - break - } - - return e.complexity.AcademicSession.StartDate(childComplexity), true - - case "Assistant.email": - if e.complexity.Assistant.Email == nil { - break - } - - return e.complexity.Assistant.Email(childComplexity), true - - case "Assistant.first_name": - if e.complexity.Assistant.FirstName == nil { - break - } - - return e.complexity.Assistant.FirstName(childComplexity), true - - case "Assistant.last_name": - if e.complexity.Assistant.LastName == nil { - break - } - - return e.complexity.Assistant.LastName(childComplexity), true - - case "Assistant.role": - if e.complexity.Assistant.Role == nil { - break - } - - return e.complexity.Assistant.Role(childComplexity), true - - case "Attributes.raw_attributes": - if e.complexity.Attributes.RawAttributes == nil { - break - } - - return e.complexity.Attributes.RawAttributes(childComplexity), true - - case "CLEPExam._id": - if e.complexity.CLEPExam.ID == nil { - break - } - - return e.complexity.CLEPExam.ID(childComplexity), true - - case "CLEPExam.name": - if e.complexity.CLEPExam.Name == nil { - break - } - - return e.complexity.CLEPExam.Name(childComplexity), true - - case "CLEPExam.yields": - if e.complexity.CLEPExam.Yields == nil { - break - } - - return e.complexity.CLEPExam.Yields(childComplexity), true - - case "CSPlacementExam._id": - if e.complexity.CSPlacementExam.ID == nil { - break - } - - return e.complexity.CSPlacementExam.ID(childComplexity), true - - case "CSPlacementExam.yields": - if e.complexity.CSPlacementExam.Yields == nil { - break - } - - return e.complexity.CSPlacementExam.Yields(childComplexity), true - - case "ChoiceRequirement.choices": - if e.complexity.ChoiceRequirement.Choices == nil { - break - } - - return e.complexity.ChoiceRequirement.Choices(childComplexity), true - - case "CollectionRequirement.name": - if e.complexity.CollectionRequirement.Name == nil { - break - } - - return e.complexity.CollectionRequirement.Name(childComplexity), true - - case "CollectionRequirement.options": - if e.complexity.CollectionRequirement.Options == nil { - break - } - - return e.complexity.CollectionRequirement.Options(childComplexity), true - - case "CollectionRequirement.required": - if e.complexity.CollectionRequirement.Required == nil { - break - } - - return e.complexity.CollectionRequirement.Required(childComplexity), true - - case "ConsentRequirement.granter": - if e.complexity.ConsentRequirement.Granter == nil { - break - } - - return e.complexity.ConsentRequirement.Granter(childComplexity), true - - case "CoreRequirement.core_flag": - if e.complexity.CoreRequirement.CoreFlag == nil { - break - } - - return e.complexity.CoreRequirement.CoreFlag(childComplexity), true - - case "CoreRequirement.hours": - if e.complexity.CoreRequirement.Hours == nil { - break - } - - return e.complexity.CoreRequirement.Hours(childComplexity), true - - case "Course.activity_type": - if e.complexity.Course.ActivityType == nil { - break - } - - return e.complexity.Course.ActivityType(childComplexity), true - - case "Course.catalog_year": - if e.complexity.Course.CatalogYear == nil { - break - } - - return e.complexity.Course.CatalogYear(childComplexity), true - - case "Course.class_level": - if e.complexity.Course.ClassLevel == nil { - break - } - - return e.complexity.Course.ClassLevel(childComplexity), true - - case "Course.co_or_pre_requisites": - if e.complexity.Course.CoOrPreRequisites == nil { - break - } - - return e.complexity.Course.CoOrPreRequisites(childComplexity), true - - case "Course.corequisites": - if e.complexity.Course.Corequisites == nil { - break - } - - return e.complexity.Course.Corequisites(childComplexity), true - - case "Course.course_number": - if e.complexity.Course.CourseNumber == nil { - break - } - - return e.complexity.Course.CourseNumber(childComplexity), true - - case "Course.credit_hours": - if e.complexity.Course.CreditHours == nil { - break - } - - return e.complexity.Course.CreditHours(childComplexity), true - - case "Course.description": - if e.complexity.Course.Description == nil { - break - } - - return e.complexity.Course.Description(childComplexity), true - - case "Course.enrollment_reqs": - if e.complexity.Course.EnrollmentReqs == nil { - break - } - - return e.complexity.Course.EnrollmentReqs(childComplexity), true - - case "Course.grading": - if e.complexity.Course.Grading == nil { - break - } - - return e.complexity.Course.Grading(childComplexity), true - - case "Course._id": - if e.complexity.Course.ID == nil { - break - } - - return e.complexity.Course.ID(childComplexity), true - - case "Course.internal_course_number": - if e.complexity.Course.InternalCourseNumber == nil { - break - } - - return e.complexity.Course.InternalCourseNumber(childComplexity), true - - case "Course.laboratory_contact_hours": - if e.complexity.Course.LaboratoryContactHours == nil { - break - } - - return e.complexity.Course.LaboratoryContactHours(childComplexity), true - - case "Course.lecture_contact_hours": - if e.complexity.Course.LectureContactHours == nil { - break - } - - return e.complexity.Course.LectureContactHours(childComplexity), true - - case "Course.offering_frequency": - if e.complexity.Course.OfferingFrequency == nil { - break - } - - return e.complexity.Course.OfferingFrequency(childComplexity), true - - case "Course.prerequisites": - if e.complexity.Course.Prerequisites == nil { - break - } - - return e.complexity.Course.Prerequisites(childComplexity), true - - case "Course.school": - if e.complexity.Course.School == nil { - break - } - - return e.complexity.Course.School(childComplexity), true - - case "Course.sections": - if e.complexity.Course.Sections == nil { - break - } - - return e.complexity.Course.Sections(childComplexity), true - - case "Course.subject_prefix": - if e.complexity.Course.SubjectPrefix == nil { - break - } - - return e.complexity.Course.SubjectPrefix(childComplexity), true - - case "Course.title": - if e.complexity.Course.Title == nil { - break - } - - return e.complexity.Course.Title(childComplexity), true - - case "CourseRequirement.class_reference": - if e.complexity.CourseRequirement.ClassReference == nil { - break - } - - return e.complexity.CourseRequirement.ClassReference(childComplexity), true - - case "CourseRequirement.minimum_grade": - if e.complexity.CourseRequirement.MinimumGrade == nil { - break - } - - return e.complexity.CourseRequirement.MinimumGrade(childComplexity), true - - case "Credit.category": - if e.complexity.Credit.Category == nil { - break - } - - return e.complexity.Credit.Category(childComplexity), true - - case "Credit.credit_hours": - if e.complexity.Credit.CreditHours == nil { - break - } - - return e.complexity.Credit.CreditHours(childComplexity), true - - case "ExamRequirement.exam_reference": - if e.complexity.ExamRequirement.ExamReference == nil { - break - } - - return e.complexity.ExamRequirement.ExamReference(childComplexity), true - - case "ExamRequirement.minimum_score": - if e.complexity.ExamRequirement.MinimumScore == nil { - break - } - - return e.complexity.ExamRequirement.MinimumScore(childComplexity), true - - case "GPARequirement.minimum": - if e.complexity.GPARequirement.Minimum == nil { - break - } - - return e.complexity.GPARequirement.Minimum(childComplexity), true - - case "GPARequirement.subset": - if e.complexity.GPARequirement.Subset == nil { - break - } - - return e.complexity.GPARequirement.Subset(childComplexity), true - - case "HoursRequirement.options": - if e.complexity.HoursRequirement.Options == nil { - break - } - - return e.complexity.HoursRequirement.Options(childComplexity), true - - case "HoursRequirement.required": - if e.complexity.HoursRequirement.Required == nil { - break - } - - return e.complexity.HoursRequirement.Required(childComplexity), true - - case "IBExam._id": - if e.complexity.IBExam.ID == nil { - break - } - - return e.complexity.IBExam.ID(childComplexity), true - - case "IBExam.level": - if e.complexity.IBExam.Level == nil { - break - } - - return e.complexity.IBExam.Level(childComplexity), true - - case "IBExam.name": - if e.complexity.IBExam.Name == nil { - break - } - - return e.complexity.IBExam.Name(childComplexity), true - - case "IBExam.yields": - if e.complexity.IBExam.Yields == nil { - break - } - - return e.complexity.IBExam.Yields(childComplexity), true - - case "LimitRequirement.max_hours": - if e.complexity.LimitRequirement.MaxHours == nil { - break - } - - return e.complexity.LimitRequirement.MaxHours(childComplexity), true - - case "Location.building": - if e.complexity.Location.Building == nil { - break - } - - return e.complexity.Location.Building(childComplexity), true - - case "Location.map_uri": - if e.complexity.Location.MapURI == nil { - break - } - - return e.complexity.Location.MapURI(childComplexity), true - - case "Location.room": - if e.complexity.Location.Room == nil { - break - } - - return e.complexity.Location.Room(childComplexity), true - - case "MajorRequirement.major": - if e.complexity.MajorRequirement.Major == nil { - break - } - - return e.complexity.MajorRequirement.Major(childComplexity), true - - case "Meeting.end_date": - if e.complexity.Meeting.EndDate == nil { - break - } - - return e.complexity.Meeting.EndDate(childComplexity), true - - case "Meeting.end_time": - if e.complexity.Meeting.EndTime == nil { - break - } - - return e.complexity.Meeting.EndTime(childComplexity), true - - case "Meeting.location": - if e.complexity.Meeting.Location == nil { - break - } - - return e.complexity.Meeting.Location(childComplexity), true - - case "Meeting.meeting_days": - if e.complexity.Meeting.MeetingDays == nil { - break - } - - return e.complexity.Meeting.MeetingDays(childComplexity), true - - case "Meeting.modality": - if e.complexity.Meeting.Modality == nil { - break - } - - return e.complexity.Meeting.Modality(childComplexity), true - - case "Meeting.start_date": - if e.complexity.Meeting.StartDate == nil { - break - } - - return e.complexity.Meeting.StartDate(childComplexity), true - - case "Meeting.start_time": - if e.complexity.Meeting.StartTime == nil { - break - } - - return e.complexity.Meeting.StartTime(childComplexity), true - - case "MinorRequirement.minor": - if e.complexity.MinorRequirement.Minor == nil { - break - } - - return e.complexity.MinorRequirement.Minor(childComplexity), true - - case "OtherRequirement.condition": - if e.complexity.OtherRequirement.Condition == nil { - break - } - - return e.complexity.OtherRequirement.Condition(childComplexity), true - - case "OtherRequirement.description": - if e.complexity.OtherRequirement.Description == nil { - break - } - - return e.complexity.OtherRequirement.Description(childComplexity), true - - case "PossibleOutcomes.possible_outcomes": - if e.complexity.PossibleOutcomes.PossibleOutcomes == nil { - break - } - - return e.complexity.PossibleOutcomes.PossibleOutcomes(childComplexity), true - - case "PossibleOutcomes.requirement": - if e.complexity.PossibleOutcomes.Requirement == nil { - break - } - - return e.complexity.PossibleOutcomes.Requirement(childComplexity), true - - case "Professor.email": - if e.complexity.Professor.Email == nil { - break - } - - return e.complexity.Professor.Email(childComplexity), true - - case "Professor.first_name": - if e.complexity.Professor.FirstName == nil { - break - } - - return e.complexity.Professor.FirstName(childComplexity), true - - case "Professor._id": - if e.complexity.Professor.ID == nil { - break - } - - return e.complexity.Professor.ID(childComplexity), true - - case "Professor.image_uri": - if e.complexity.Professor.ImageURI == nil { - break - } - - return e.complexity.Professor.ImageURI(childComplexity), true - - case "Professor.last_name": - if e.complexity.Professor.LastName == nil { - break - } - - return e.complexity.Professor.LastName(childComplexity), true - - case "Professor.office": - if e.complexity.Professor.Office == nil { - break - } - - return e.complexity.Professor.Office(childComplexity), true - - case "Professor.office_hours": - if e.complexity.Professor.OfficeHours == nil { - break - } - - return e.complexity.Professor.OfficeHours(childComplexity), true - - case "Professor.phone_number": - if e.complexity.Professor.PhoneNumber == nil { - break - } - - return e.complexity.Professor.PhoneNumber(childComplexity), true - - case "Professor.profile_uri": - if e.complexity.Professor.ProfileURI == nil { - break - } - - return e.complexity.Professor.ProfileURI(childComplexity), true - - case "Professor.sections": - if e.complexity.Professor.Sections == nil { - break - } - - return e.complexity.Professor.Sections(childComplexity), true - - case "Professor.titles": - if e.complexity.Professor.Titles == nil { - break - } - - return e.complexity.Professor.Titles(childComplexity), true - - case "Query.course": - if e.complexity.Query.Course == nil { - break - } - - args, err := ec.field_Query_course_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Course(childComplexity, args["course_number"].(*string), args["subject_prefix"].(*string), args["title"].(*string), args["description"].(*string), args["school"].(*string), args["credit_hours"].(*string), args["class_level"].(*string), args["activity_type"].(*string), args["grading"].(*string), args["internal_course_number"].(*string), args["lecture_contact_hours"].(*string), args["offering_frequency"].(*string)), true - - case "Query.courseByID": - if e.complexity.Query.CourseByID == nil { - break - } - - args, err := ec.field_Query_courseByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.CourseByID(childComplexity, args["id"].(string)), true - - case "Query.exam": - if e.complexity.Query.Exam == nil { - break - } - - args, err := ec.field_Query_exam_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Exam(childComplexity, args["type"].(*string), args["name"].(*string), args["level"].(*string)), true - - case "Query.examByID": - if e.complexity.Query.ExamByID == nil { - break - } - - args, err := ec.field_Query_examByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.ExamByID(childComplexity, args["id"].(string)), true - - case "Query.professor": - if e.complexity.Query.Professor == nil { - break - } - - args, err := ec.field_Query_professor_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Professor(childComplexity, args["first_name"].(*string), args["last_name"].(*string), args["titles"].([]string), args["email"].(*string), args["phone_number"].(*string), args["profile_uri"].(*string), args["image_uri"].(*string)), true - - case "Query.professorByID": - if e.complexity.Query.ProfessorByID == nil { - break - } - - args, err := ec.field_Query_professorByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.ProfessorByID(childComplexity, args["id"].(string)), true - - case "Query.section": - if e.complexity.Query.Section == nil { - break - } - - args, err := ec.field_Query_section_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.Section(childComplexity, args["section_number"].(*string), args["course_reference"].(*string), args["internal_class_number"].(*string), args["instruction_mode"].(*string), args["syllabus_uri"].(*string)), true - - case "Query.sectionByID": - if e.complexity.Query.SectionByID == nil { - break - } - - args, err := ec.field_Query_sectionByID_args(context.TODO(), rawArgs) - if err != nil { - return 0, false - } - - return e.complexity.Query.SectionByID(childComplexity, args["id"].(string)), true - - case "Section.academic_session": - if e.complexity.Section.AcademicSession == nil { - break - } - - return e.complexity.Section.AcademicSession(childComplexity), true - - case "Section.attributes": - if e.complexity.Section.Attributes == nil { - break - } - - return e.complexity.Section.Attributes(childComplexity), true - - case "Section.core_flags": - if e.complexity.Section.CoreFlags == nil { - break - } - - return e.complexity.Section.CoreFlags(childComplexity), true - - case "Section.course_reference": - if e.complexity.Section.CourseReference == nil { - break - } - - return e.complexity.Section.CourseReference(childComplexity), true - - case "Section.grade_distribution": - if e.complexity.Section.GradeDistribution == nil { - break - } - - return e.complexity.Section.GradeDistribution(childComplexity), true - - case "Section._id": - if e.complexity.Section.ID == nil { - break - } - - return e.complexity.Section.ID(childComplexity), true - - case "Section.instruction_mode": - if e.complexity.Section.InstructionMode == nil { - break - } - - return e.complexity.Section.InstructionMode(childComplexity), true - - case "Section.internal_class_number": - if e.complexity.Section.InternalClassNumber == nil { - break - } - - return e.complexity.Section.InternalClassNumber(childComplexity), true - - case "Section.meetings": - if e.complexity.Section.Meetings == nil { - break - } - - return e.complexity.Section.Meetings(childComplexity), true - - case "Section.professors": - if e.complexity.Section.Professors == nil { - break - } - - return e.complexity.Section.Professors(childComplexity), true - - case "Section.section_corequisites": - if e.complexity.Section.SectionCorequisites == nil { - break - } - - return e.complexity.Section.SectionCorequisites(childComplexity), true - - case "Section.section_number": - if e.complexity.Section.SectionNumber == nil { - break - } - - return e.complexity.Section.SectionNumber(childComplexity), true - - case "Section.syllabus_uri": - if e.complexity.Section.SyllabusURI == nil { - break - } - - return e.complexity.Section.SyllabusURI(childComplexity), true - - case "Section.teaching_assistants": - if e.complexity.Section.TeachingAssistants == nil { - break - } - - return e.complexity.Section.TeachingAssistants(childComplexity), true - - case "SectionRequirement.section_reference": - if e.complexity.SectionRequirement.SectionReference == nil { - break - } - - return e.complexity.SectionRequirement.SectionReference(childComplexity), true - - } - return 0, false -} - -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - inputUnmarshalMap := graphql.BuildUnmarshalerMap() - first := true - - switch rc.Operation.Operation { - case ast.Query: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Query(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) - - return &graphql.Response{ - Data: buf.Bytes(), - } - } - - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} - -type executionContext struct { - *graphql.OperationContext - *executableSchema -} - -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} - -func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil -} - -//go:embed "schema/academic_session.graphqls" "schema/assistant.graphqls" "schema/course.graphqls" "schema/credit.graphqls" "schema/exam.graphqls" "schema/location.graphqls" "schema/meeting.graphqls" "schema/professor.graphqls" "schema/requirement.graphqls" "schema/schema.graphqls" "schema/section.graphqls" -var sourcesFS embed.FS - -func sourceData(filename string) string { - data, err := sourcesFS.ReadFile(filename) - if err != nil { - panic(fmt.Sprintf("codegen problem: %s not available", filename)) - } - return string(data) -} - -var sources = []*ast.Source{ - {Name: "schema/academic_session.graphqls", Input: sourceData("schema/academic_session.graphqls"), BuiltIn: false}, - {Name: "schema/assistant.graphqls", Input: sourceData("schema/assistant.graphqls"), BuiltIn: false}, - {Name: "schema/course.graphqls", Input: sourceData("schema/course.graphqls"), BuiltIn: false}, - {Name: "schema/credit.graphqls", Input: sourceData("schema/credit.graphqls"), BuiltIn: false}, - {Name: "schema/exam.graphqls", Input: sourceData("schema/exam.graphqls"), BuiltIn: false}, - {Name: "schema/location.graphqls", Input: sourceData("schema/location.graphqls"), BuiltIn: false}, - {Name: "schema/meeting.graphqls", Input: sourceData("schema/meeting.graphqls"), BuiltIn: false}, - {Name: "schema/professor.graphqls", Input: sourceData("schema/professor.graphqls"), BuiltIn: false}, - {Name: "schema/requirement.graphqls", Input: sourceData("schema/requirement.graphqls"), BuiltIn: false}, - {Name: "schema/schema.graphqls", Input: sourceData("schema/schema.graphqls"), BuiltIn: false}, - {Name: "schema/section.graphqls", Input: sourceData("schema/section.graphqls"), BuiltIn: false}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) - -// endregion ************************** generated!.gotpl ************************** - -// region ***************************** args.gotpl ***************************** - -func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_courseByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_course_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["course_number"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("course_number")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["course_number"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["subject_prefix"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("subject_prefix")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["subject_prefix"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["title"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["title"] = arg2 - var arg3 *string - if tmp, ok := rawArgs["description"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("description")) - arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["description"] = arg3 - var arg4 *string - if tmp, ok := rawArgs["school"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("school")) - arg4, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["school"] = arg4 - var arg5 *string - if tmp, ok := rawArgs["credit_hours"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("credit_hours")) - arg5, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["credit_hours"] = arg5 - var arg6 *string - if tmp, ok := rawArgs["class_level"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("class_level")) - arg6, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["class_level"] = arg6 - var arg7 *string - if tmp, ok := rawArgs["activity_type"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("activity_type")) - arg7, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["activity_type"] = arg7 - var arg8 *string - if tmp, ok := rawArgs["grading"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("grading")) - arg8, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["grading"] = arg8 - var arg9 *string - if tmp, ok := rawArgs["internal_course_number"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("internal_course_number")) - arg9, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["internal_course_number"] = arg9 - var arg10 *string - if tmp, ok := rawArgs["lecture_contact_hours"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("lecture_contact_hours")) - arg10, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["lecture_contact_hours"] = arg10 - var arg11 *string - if tmp, ok := rawArgs["offering_frequency"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("offering_frequency")) - arg11, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["offering_frequency"] = arg11 - return args, nil -} - -func (ec *executionContext) field_Query_examByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_exam_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["type"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("type")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["type"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["name"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["level"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("level")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["level"] = arg2 - return args, nil -} - -func (ec *executionContext) field_Query_professorByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_professor_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["first_name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("first_name")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["first_name"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["last_name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last_name")) - arg1, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["last_name"] = arg1 - var arg2 []string - if tmp, ok := rawArgs["titles"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("titles")) - arg2, err = ec.unmarshalOString2ᚕstringᚄ(ctx, tmp) - if err != nil { - return nil, err - } - } - args["titles"] = arg2 - var arg3 *string - if tmp, ok := rawArgs["email"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) - arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["email"] = arg3 - var arg4 *string - if tmp, ok := rawArgs["phone_number"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("phone_number")) - arg4, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["phone_number"] = arg4 - var arg5 *string - if tmp, ok := rawArgs["profile_uri"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("profile_uri")) - arg5, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["profile_uri"] = arg5 - var arg6 *string - if tmp, ok := rawArgs["image_uri"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("image_uri")) - arg6, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["image_uri"] = arg6 - return args, nil -} - -func (ec *executionContext) field_Query_sectionByID_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["id"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } - } - args["id"] = arg0 - return args, nil -} - -func (ec *executionContext) field_Query_section_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 *string - if tmp, ok := rawArgs["section_number"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("section_number")) - arg0, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["section_number"] = arg0 - var arg1 *string - if tmp, ok := rawArgs["course_reference"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("course_reference")) - arg1, err = ec.unmarshalOID2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["course_reference"] = arg1 - var arg2 *string - if tmp, ok := rawArgs["internal_class_number"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("internal_class_number")) - arg2, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["internal_class_number"] = arg2 - var arg3 *string - if tmp, ok := rawArgs["instruction_mode"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("instruction_mode")) - arg3, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["instruction_mode"] = arg3 - var arg4 *string - if tmp, ok := rawArgs["syllabus_uri"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("syllabus_uri")) - arg4, err = ec.unmarshalOString2ᚖstring(ctx, tmp) - if err != nil { - return nil, err - } - } - args["syllabus_uri"] = arg4 - return args, nil -} - -func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } - } - args["includeDeprecated"] = arg0 - return args, nil -} - -// endregion ***************************** args.gotpl ***************************** - -// region ************************** directives.gotpl ************************** - -// endregion ************************** directives.gotpl ************************** - -// region **************************** field.gotpl ***************************** - -func (ec *executionContext) _ALEKSExam__id(ctx context.Context, field graphql.CollectedField, obj *model.ALEKSExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ALEKSExam__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ALEKSExam__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ALEKSExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ALEKSExam_placement(ctx context.Context, field graphql.CollectedField, obj *model.ALEKSExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ALEKSExam_placement(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Placement, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.PossibleOutcomes) - fc.Result = res - return ec.marshalNPossibleOutcomes2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomesᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ALEKSExam_placement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ALEKSExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "requirement": - return ec.fieldContext_PossibleOutcomes_requirement(ctx, field) - case "possible_outcomes": - return ec.fieldContext_PossibleOutcomes_possible_outcomes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PossibleOutcomes", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _APExam__id(ctx context.Context, field graphql.CollectedField, obj *model.APExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_APExam__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_APExam__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "APExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _APExam_name(ctx context.Context, field graphql.CollectedField, obj *model.APExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_APExam_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_APExam_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "APExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _APExam_yields(ctx context.Context, field graphql.CollectedField, obj *model.APExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_APExam_yields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Yields, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.PossibleOutcomes) - fc.Result = res - return ec.marshalNPossibleOutcomes2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomesᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_APExam_yields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "APExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "requirement": - return ec.fieldContext_PossibleOutcomes_requirement(ctx, field) - case "possible_outcomes": - return ec.fieldContext_PossibleOutcomes_possible_outcomes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PossibleOutcomes", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _AcademicSession_name(ctx context.Context, field graphql.CollectedField, obj *model.AcademicSession) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AcademicSession_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_AcademicSession_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AcademicSession", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _AcademicSession_start_date(ctx context.Context, field graphql.CollectedField, obj *model.AcademicSession) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AcademicSession_start_date(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.StartDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_AcademicSession_start_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AcademicSession", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _AcademicSession_end_date(ctx context.Context, field graphql.CollectedField, obj *model.AcademicSession) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_AcademicSession_end_date(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EndDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_AcademicSession_end_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "AcademicSession", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Assistant_first_name(ctx context.Context, field graphql.CollectedField, obj *model.Assistant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Assistant_first_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FirstName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Assistant_first_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Assistant", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Assistant_last_name(ctx context.Context, field graphql.CollectedField, obj *model.Assistant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Assistant_last_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LastName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Assistant_last_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Assistant", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Assistant_role(ctx context.Context, field graphql.CollectedField, obj *model.Assistant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Assistant_role(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Role, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Assistant_role(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Assistant", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Assistant_email(ctx context.Context, field graphql.CollectedField, obj *model.Assistant) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Assistant_email(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Email, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Assistant_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Assistant", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Attributes_raw_attributes(ctx context.Context, field graphql.CollectedField, obj *model.Attributes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Attributes_raw_attributes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.RawAttributes, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Attributes_raw_attributes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Attributes", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CLEPExam__id(ctx context.Context, field graphql.CollectedField, obj *model.CLEPExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CLEPExam__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CLEPExam__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CLEPExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CLEPExam_name(ctx context.Context, field graphql.CollectedField, obj *model.CLEPExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CLEPExam_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CLEPExam_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CLEPExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CLEPExam_yields(ctx context.Context, field graphql.CollectedField, obj *model.CLEPExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CLEPExam_yields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Yields, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.PossibleOutcomes) - fc.Result = res - return ec.marshalNPossibleOutcomes2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomesᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CLEPExam_yields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CLEPExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "requirement": - return ec.fieldContext_PossibleOutcomes_requirement(ctx, field) - case "possible_outcomes": - return ec.fieldContext_PossibleOutcomes_possible_outcomes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PossibleOutcomes", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _CSPlacementExam__id(ctx context.Context, field graphql.CollectedField, obj *model.CSPlacementExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CSPlacementExam__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CSPlacementExam__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CSPlacementExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CSPlacementExam_yields(ctx context.Context, field graphql.CollectedField, obj *model.CSPlacementExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CSPlacementExam_yields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Yields, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.PossibleOutcomes) - fc.Result = res - return ec.marshalNPossibleOutcomes2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomesᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CSPlacementExam_yields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CSPlacementExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "requirement": - return ec.fieldContext_PossibleOutcomes_requirement(ctx, field) - case "possible_outcomes": - return ec.fieldContext_PossibleOutcomes_possible_outcomes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PossibleOutcomes", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _ChoiceRequirement_choices(ctx context.Context, field graphql.CollectedField, obj *model.ChoiceRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ChoiceRequirement_choices(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Choices, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.CollectionRequirement) - fc.Result = res - return ec.marshalNCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ChoiceRequirement_choices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ChoiceRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_CollectionRequirement_name(ctx, field) - case "required": - return ec.fieldContext_CollectionRequirement_required(ctx, field) - case "options": - return ec.fieldContext_CollectionRequirement_options(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CollectionRequirement", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _CollectionRequirement_name(ctx context.Context, field graphql.CollectedField, obj *model.CollectionRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CollectionRequirement_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CollectionRequirement_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CollectionRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CollectionRequirement_required(ctx context.Context, field graphql.CollectedField, obj *model.CollectionRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CollectionRequirement_required(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Required, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CollectionRequirement_required(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CollectionRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CollectionRequirement_options(ctx context.Context, field graphql.CollectedField, obj *model.CollectionRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CollectionRequirement_options(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.CollectionRequirement().Options(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]model.Requirement) - fc.Result = res - return ec.marshalNRequirement2ᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐRequirementᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CollectionRequirement_options(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CollectionRequirement", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Requirement does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ConsentRequirement_granter(ctx context.Context, field graphql.CollectedField, obj *model.ConsentRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ConsentRequirement_granter(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Granter, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ConsentRequirement_granter(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ConsentRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CoreRequirement_core_flag(ctx context.Context, field graphql.CollectedField, obj *model.CoreRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CoreRequirement_core_flag(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CoreFlag, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CoreRequirement_core_flag(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CoreRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CoreRequirement_hours(ctx context.Context, field graphql.CollectedField, obj *model.CoreRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CoreRequirement_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Hours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CoreRequirement_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CoreRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course__id(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_course_number(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_course_number(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CourseNumber, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_course_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_subject_prefix(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_subject_prefix(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SubjectPrefix, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_subject_prefix(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_title(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_title(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Title, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_description(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_enrollment_reqs(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_enrollment_reqs(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnrollmentReqs, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_enrollment_reqs(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_school(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_school(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.School, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_school(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_credit_hours(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_credit_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreditHours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_credit_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_class_level(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_class_level(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ClassLevel, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_class_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_activity_type(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_activity_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ActivityType, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_activity_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_grading(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_grading(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Grading, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_grading(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_internal_course_number(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_internal_course_number(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InternalCourseNumber, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_internal_course_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_prerequisites(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_prerequisites(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Prerequisites, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.CollectionRequirement) - fc.Result = res - return ec.marshalOCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_prerequisites(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_CollectionRequirement_name(ctx, field) - case "required": - return ec.fieldContext_CollectionRequirement_required(ctx, field) - case "options": - return ec.fieldContext_CollectionRequirement_options(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CollectionRequirement", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_corequisites(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_corequisites(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Corequisites, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.CollectionRequirement) - fc.Result = res - return ec.marshalOCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_corequisites(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_CollectionRequirement_name(ctx, field) - case "required": - return ec.fieldContext_CollectionRequirement_required(ctx, field) - case "options": - return ec.fieldContext_CollectionRequirement_options(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CollectionRequirement", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_co_or_pre_requisites(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_co_or_pre_requisites(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CoOrPreRequisites, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.CollectionRequirement) - fc.Result = res - return ec.marshalOCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_co_or_pre_requisites(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_CollectionRequirement_name(ctx, field) - case "required": - return ec.fieldContext_CollectionRequirement_required(ctx, field) - case "options": - return ec.fieldContext_CollectionRequirement_options(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CollectionRequirement", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_sections(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_sections(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Course().Sections(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Section) - fc.Result = res - return ec.marshalNSection2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSectionᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_sections(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Section__id(ctx, field) - case "section_number": - return ec.fieldContext_Section_section_number(ctx, field) - case "course_reference": - return ec.fieldContext_Section_course_reference(ctx, field) - case "section_corequisites": - return ec.fieldContext_Section_section_corequisites(ctx, field) - case "academic_session": - return ec.fieldContext_Section_academic_session(ctx, field) - case "professors": - return ec.fieldContext_Section_professors(ctx, field) - case "teaching_assistants": - return ec.fieldContext_Section_teaching_assistants(ctx, field) - case "internal_class_number": - return ec.fieldContext_Section_internal_class_number(ctx, field) - case "instruction_mode": - return ec.fieldContext_Section_instruction_mode(ctx, field) - case "meetings": - return ec.fieldContext_Section_meetings(ctx, field) - case "core_flags": - return ec.fieldContext_Section_core_flags(ctx, field) - case "syllabus_uri": - return ec.fieldContext_Section_syllabus_uri(ctx, field) - case "grade_distribution": - return ec.fieldContext_Section_grade_distribution(ctx, field) - case "attributes": - return ec.fieldContext_Section_attributes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Section", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_lecture_contact_hours(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_lecture_contact_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LectureContactHours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_lecture_contact_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_laboratory_contact_hours(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_laboratory_contact_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LaboratoryContactHours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_laboratory_contact_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_offering_frequency(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_offering_frequency(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OfferingFrequency, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_offering_frequency(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Course_catalog_year(ctx context.Context, field graphql.CollectedField, obj *model.Course) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Course_catalog_year(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CatalogYear, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Course_catalog_year(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Course", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _CourseRequirement_class_reference(ctx context.Context, field graphql.CollectedField, obj *model.CourseRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CourseRequirement_class_reference(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.CourseRequirement().ClassReference(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Course) - fc.Result = res - return ec.marshalNCourse2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CourseRequirement_class_reference(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CourseRequirement", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Course__id(ctx, field) - case "course_number": - return ec.fieldContext_Course_course_number(ctx, field) - case "subject_prefix": - return ec.fieldContext_Course_subject_prefix(ctx, field) - case "title": - return ec.fieldContext_Course_title(ctx, field) - case "description": - return ec.fieldContext_Course_description(ctx, field) - case "enrollment_reqs": - return ec.fieldContext_Course_enrollment_reqs(ctx, field) - case "school": - return ec.fieldContext_Course_school(ctx, field) - case "credit_hours": - return ec.fieldContext_Course_credit_hours(ctx, field) - case "class_level": - return ec.fieldContext_Course_class_level(ctx, field) - case "activity_type": - return ec.fieldContext_Course_activity_type(ctx, field) - case "grading": - return ec.fieldContext_Course_grading(ctx, field) - case "internal_course_number": - return ec.fieldContext_Course_internal_course_number(ctx, field) - case "prerequisites": - return ec.fieldContext_Course_prerequisites(ctx, field) - case "corequisites": - return ec.fieldContext_Course_corequisites(ctx, field) - case "co_or_pre_requisites": - return ec.fieldContext_Course_co_or_pre_requisites(ctx, field) - case "sections": - return ec.fieldContext_Course_sections(ctx, field) - case "lecture_contact_hours": - return ec.fieldContext_Course_lecture_contact_hours(ctx, field) - case "laboratory_contact_hours": - return ec.fieldContext_Course_laboratory_contact_hours(ctx, field) - case "offering_frequency": - return ec.fieldContext_Course_offering_frequency(ctx, field) - case "catalog_year": - return ec.fieldContext_Course_catalog_year(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Course", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _CourseRequirement_minimum_grade(ctx context.Context, field graphql.CollectedField, obj *model.CourseRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_CourseRequirement_minimum_grade(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MinimumGrade, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_CourseRequirement_minimum_grade(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "CourseRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Credit_category(ctx context.Context, field graphql.CollectedField, obj *model.Credit) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Credit_category(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Category, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Credit_category(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Credit", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Credit_credit_hours(ctx context.Context, field graphql.CollectedField, obj *model.Credit) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Credit_credit_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CreditHours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Credit_credit_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Credit", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _ExamRequirement_exam_reference(ctx context.Context, field graphql.CollectedField, obj *model.ExamRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamRequirement_exam_reference(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.ExamRequirement().ExamReference(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(model.Exam) - fc.Result = res - return ec.marshalNExam2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐExam(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ExamRequirement_exam_reference(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ExamRequirement", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") - }, - } - return fc, nil -} - -func (ec *executionContext) _ExamRequirement_minimum_score(ctx context.Context, field graphql.CollectedField, obj *model.ExamRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_ExamRequirement_minimum_score(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MinimumScore, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_ExamRequirement_minimum_score(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "ExamRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GPARequirement_minimum(ctx context.Context, field graphql.CollectedField, obj *model.GPARequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GPARequirement_minimum(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Minimum, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(float64) - fc.Result = res - return ec.marshalNFloat2float64(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GPARequirement_minimum(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GPARequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Float does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _GPARequirement_subset(ctx context.Context, field graphql.CollectedField, obj *model.GPARequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_GPARequirement_subset(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Subset, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_GPARequirement_subset(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "GPARequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _HoursRequirement_required(ctx context.Context, field graphql.CollectedField, obj *model.HoursRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HoursRequirement_required(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Required, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_HoursRequirement_required(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HoursRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _HoursRequirement_options(ctx context.Context, field graphql.CollectedField, obj *model.HoursRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_HoursRequirement_options(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Options, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.CourseRequirement) - fc.Result = res - return ec.marshalNCourseRequirement2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourseRequirementᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_HoursRequirement_options(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "HoursRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "class_reference": - return ec.fieldContext_CourseRequirement_class_reference(ctx, field) - case "minimum_grade": - return ec.fieldContext_CourseRequirement_minimum_grade(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CourseRequirement", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _IBExam__id(ctx context.Context, field graphql.CollectedField, obj *model.IBExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IBExam__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IBExam__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IBExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IBExam_name(ctx context.Context, field graphql.CollectedField, obj *model.IBExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IBExam_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IBExam_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IBExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IBExam_level(ctx context.Context, field graphql.CollectedField, obj *model.IBExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IBExam_level(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Level, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IBExam_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IBExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _IBExam_yields(ctx context.Context, field graphql.CollectedField, obj *model.IBExam) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_IBExam_yields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Yields, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.PossibleOutcomes) - fc.Result = res - return ec.marshalNPossibleOutcomes2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomesᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_IBExam_yields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "IBExam", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "requirement": - return ec.fieldContext_PossibleOutcomes_requirement(ctx, field) - case "possible_outcomes": - return ec.fieldContext_PossibleOutcomes_possible_outcomes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type PossibleOutcomes", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _LimitRequirement_max_hours(ctx context.Context, field graphql.CollectedField, obj *model.LimitRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_LimitRequirement_max_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MaxHours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(int) - fc.Result = res - return ec.marshalNInt2int(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_LimitRequirement_max_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "LimitRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Location_building(ctx context.Context, field graphql.CollectedField, obj *model.Location) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Location_building(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Building, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Location_building(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Location", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Location_room(ctx context.Context, field graphql.CollectedField, obj *model.Location) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Location_room(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Room, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Location_room(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Location", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Location_map_uri(ctx context.Context, field graphql.CollectedField, obj *model.Location) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Location_map_uri(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MapURI, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Location_map_uri(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Location", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _MajorRequirement_major(ctx context.Context, field graphql.CollectedField, obj *model.MajorRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MajorRequirement_major(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Major, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_MajorRequirement_major(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MajorRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_start_date(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_start_date(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.StartDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_start_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_end_date(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_end_date(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EndDate, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_end_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_meeting_days(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_meeting_days(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MeetingDays, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_meeting_days(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_start_time(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_start_time(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.StartTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_start_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_end_time(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_end_time(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EndTime, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_end_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_modality(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_modality(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Modality, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(model.ModalityType) - fc.Result = res - return ec.marshalNModalityType2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐModalityType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_modality(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ModalityType does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Meeting_location(ctx context.Context, field graphql.CollectedField, obj *model.Meeting) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Meeting_location(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Location, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Location) - fc.Result = res - return ec.marshalNLocation2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐLocation(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Meeting_location(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Meeting", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "building": - return ec.fieldContext_Location_building(ctx, field) - case "room": - return ec.fieldContext_Location_room(ctx, field) - case "map_uri": - return ec.fieldContext_Location_map_uri(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Location", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _MinorRequirement_minor(ctx context.Context, field graphql.CollectedField, obj *model.MinorRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_MinorRequirement_minor(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Minor, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_MinorRequirement_minor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "MinorRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OtherRequirement_description(ctx context.Context, field graphql.CollectedField, obj *model.OtherRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OtherRequirement_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OtherRequirement_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OtherRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _OtherRequirement_condition(ctx context.Context, field graphql.CollectedField, obj *model.OtherRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_OtherRequirement_condition(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Condition, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_OtherRequirement_condition(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "OtherRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _PossibleOutcomes_requirement(ctx context.Context, field graphql.CollectedField, obj *model.PossibleOutcomes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PossibleOutcomes_requirement(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.PossibleOutcomes().Requirement(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(model.Requirement) - fc.Result = res - return ec.marshalORequirement2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐRequirement(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_PossibleOutcomes_requirement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "PossibleOutcomes", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Requirement does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _PossibleOutcomes_possible_outcomes(ctx context.Context, field graphql.CollectedField, obj *model.PossibleOutcomes) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_PossibleOutcomes_possible_outcomes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.PossibleOutcomes().PossibleOutcomes(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([][]model.Outcome) - fc.Result = res - return ec.marshalNOutcome2ᚕᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐOutcomeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_PossibleOutcomes_possible_outcomes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "PossibleOutcomes", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Outcome does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor__id(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_first_name(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_first_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FirstName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_first_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_last_name(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_last_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.LastName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_last_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_titles(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_titles(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Titles, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_titles(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_email(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_email(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Email, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_phone_number(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_phone_number(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PhoneNumber, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_phone_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_office(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_office(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Office, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*model.Location) - fc.Result = res - return ec.marshalOLocation2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐLocation(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_office(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "building": - return ec.fieldContext_Location_building(ctx, field) - case "room": - return ec.fieldContext_Location_room(ctx, field) - case "map_uri": - return ec.fieldContext_Location_map_uri(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Location", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_profile_uri(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_profile_uri(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProfileURI, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_profile_uri(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_image_uri(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_image_uri(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ImageURI, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_image_uri(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_office_hours(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_office_hours(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OfficeHours, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Meeting) - fc.Result = res - return ec.marshalNMeeting2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐMeetingᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_office_hours(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "start_date": - return ec.fieldContext_Meeting_start_date(ctx, field) - case "end_date": - return ec.fieldContext_Meeting_end_date(ctx, field) - case "meeting_days": - return ec.fieldContext_Meeting_meeting_days(ctx, field) - case "start_time": - return ec.fieldContext_Meeting_start_time(ctx, field) - case "end_time": - return ec.fieldContext_Meeting_end_time(ctx, field) - case "modality": - return ec.fieldContext_Meeting_modality(ctx, field) - case "location": - return ec.fieldContext_Meeting_location(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Meeting", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Professor_sections(ctx context.Context, field graphql.CollectedField, obj *model.Professor) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Professor_sections(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Professor().Sections(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Section) - fc.Result = res - return ec.marshalNSection2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSectionᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Professor_sections(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Professor", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Section__id(ctx, field) - case "section_number": - return ec.fieldContext_Section_section_number(ctx, field) - case "course_reference": - return ec.fieldContext_Section_course_reference(ctx, field) - case "section_corequisites": - return ec.fieldContext_Section_section_corequisites(ctx, field) - case "academic_session": - return ec.fieldContext_Section_academic_session(ctx, field) - case "professors": - return ec.fieldContext_Section_professors(ctx, field) - case "teaching_assistants": - return ec.fieldContext_Section_teaching_assistants(ctx, field) - case "internal_class_number": - return ec.fieldContext_Section_internal_class_number(ctx, field) - case "instruction_mode": - return ec.fieldContext_Section_instruction_mode(ctx, field) - case "meetings": - return ec.fieldContext_Section_meetings(ctx, field) - case "core_flags": - return ec.fieldContext_Section_core_flags(ctx, field) - case "syllabus_uri": - return ec.fieldContext_Section_syllabus_uri(ctx, field) - case "grade_distribution": - return ec.fieldContext_Section_grade_distribution(ctx, field) - case "attributes": - return ec.fieldContext_Section_attributes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Section", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Query_courseByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_courseByID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().CourseByID(rctx, fc.Args["id"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Course) - fc.Result = res - return ec.marshalNCourse2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_courseByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Course__id(ctx, field) - case "course_number": - return ec.fieldContext_Course_course_number(ctx, field) - case "subject_prefix": - return ec.fieldContext_Course_subject_prefix(ctx, field) - case "title": - return ec.fieldContext_Course_title(ctx, field) - case "description": - return ec.fieldContext_Course_description(ctx, field) - case "enrollment_reqs": - return ec.fieldContext_Course_enrollment_reqs(ctx, field) - case "school": - return ec.fieldContext_Course_school(ctx, field) - case "credit_hours": - return ec.fieldContext_Course_credit_hours(ctx, field) - case "class_level": - return ec.fieldContext_Course_class_level(ctx, field) - case "activity_type": - return ec.fieldContext_Course_activity_type(ctx, field) - case "grading": - return ec.fieldContext_Course_grading(ctx, field) - case "internal_course_number": - return ec.fieldContext_Course_internal_course_number(ctx, field) - case "prerequisites": - return ec.fieldContext_Course_prerequisites(ctx, field) - case "corequisites": - return ec.fieldContext_Course_corequisites(ctx, field) - case "co_or_pre_requisites": - return ec.fieldContext_Course_co_or_pre_requisites(ctx, field) - case "sections": - return ec.fieldContext_Course_sections(ctx, field) - case "lecture_contact_hours": - return ec.fieldContext_Course_lecture_contact_hours(ctx, field) - case "laboratory_contact_hours": - return ec.fieldContext_Course_laboratory_contact_hours(ctx, field) - case "offering_frequency": - return ec.fieldContext_Course_offering_frequency(ctx, field) - case "catalog_year": - return ec.fieldContext_Course_catalog_year(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Course", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_courseByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_course(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_course(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Course(rctx, fc.Args["course_number"].(*string), fc.Args["subject_prefix"].(*string), fc.Args["title"].(*string), fc.Args["description"].(*string), fc.Args["school"].(*string), fc.Args["credit_hours"].(*string), fc.Args["class_level"].(*string), fc.Args["activity_type"].(*string), fc.Args["grading"].(*string), fc.Args["internal_course_number"].(*string), fc.Args["lecture_contact_hours"].(*string), fc.Args["offering_frequency"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Course) - fc.Result = res - return ec.marshalNCourse2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourseᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_course(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Course__id(ctx, field) - case "course_number": - return ec.fieldContext_Course_course_number(ctx, field) - case "subject_prefix": - return ec.fieldContext_Course_subject_prefix(ctx, field) - case "title": - return ec.fieldContext_Course_title(ctx, field) - case "description": - return ec.fieldContext_Course_description(ctx, field) - case "enrollment_reqs": - return ec.fieldContext_Course_enrollment_reqs(ctx, field) - case "school": - return ec.fieldContext_Course_school(ctx, field) - case "credit_hours": - return ec.fieldContext_Course_credit_hours(ctx, field) - case "class_level": - return ec.fieldContext_Course_class_level(ctx, field) - case "activity_type": - return ec.fieldContext_Course_activity_type(ctx, field) - case "grading": - return ec.fieldContext_Course_grading(ctx, field) - case "internal_course_number": - return ec.fieldContext_Course_internal_course_number(ctx, field) - case "prerequisites": - return ec.fieldContext_Course_prerequisites(ctx, field) - case "corequisites": - return ec.fieldContext_Course_corequisites(ctx, field) - case "co_or_pre_requisites": - return ec.fieldContext_Course_co_or_pre_requisites(ctx, field) - case "sections": - return ec.fieldContext_Course_sections(ctx, field) - case "lecture_contact_hours": - return ec.fieldContext_Course_lecture_contact_hours(ctx, field) - case "laboratory_contact_hours": - return ec.fieldContext_Course_laboratory_contact_hours(ctx, field) - case "offering_frequency": - return ec.fieldContext_Course_offering_frequency(ctx, field) - case "catalog_year": - return ec.fieldContext_Course_catalog_year(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Course", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_course_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_sectionByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_sectionByID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().SectionByID(rctx, fc.Args["id"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Section) - fc.Result = res - return ec.marshalNSection2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSection(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_sectionByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Section__id(ctx, field) - case "section_number": - return ec.fieldContext_Section_section_number(ctx, field) - case "course_reference": - return ec.fieldContext_Section_course_reference(ctx, field) - case "section_corequisites": - return ec.fieldContext_Section_section_corequisites(ctx, field) - case "academic_session": - return ec.fieldContext_Section_academic_session(ctx, field) - case "professors": - return ec.fieldContext_Section_professors(ctx, field) - case "teaching_assistants": - return ec.fieldContext_Section_teaching_assistants(ctx, field) - case "internal_class_number": - return ec.fieldContext_Section_internal_class_number(ctx, field) - case "instruction_mode": - return ec.fieldContext_Section_instruction_mode(ctx, field) - case "meetings": - return ec.fieldContext_Section_meetings(ctx, field) - case "core_flags": - return ec.fieldContext_Section_core_flags(ctx, field) - case "syllabus_uri": - return ec.fieldContext_Section_syllabus_uri(ctx, field) - case "grade_distribution": - return ec.fieldContext_Section_grade_distribution(ctx, field) - case "attributes": - return ec.fieldContext_Section_attributes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Section", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_sectionByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_section(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_section(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Section(rctx, fc.Args["section_number"].(*string), fc.Args["course_reference"].(*string), fc.Args["internal_class_number"].(*string), fc.Args["instruction_mode"].(*string), fc.Args["syllabus_uri"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Section) - fc.Result = res - return ec.marshalNSection2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSectionᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_section(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Section__id(ctx, field) - case "section_number": - return ec.fieldContext_Section_section_number(ctx, field) - case "course_reference": - return ec.fieldContext_Section_course_reference(ctx, field) - case "section_corequisites": - return ec.fieldContext_Section_section_corequisites(ctx, field) - case "academic_session": - return ec.fieldContext_Section_academic_session(ctx, field) - case "professors": - return ec.fieldContext_Section_professors(ctx, field) - case "teaching_assistants": - return ec.fieldContext_Section_teaching_assistants(ctx, field) - case "internal_class_number": - return ec.fieldContext_Section_internal_class_number(ctx, field) - case "instruction_mode": - return ec.fieldContext_Section_instruction_mode(ctx, field) - case "meetings": - return ec.fieldContext_Section_meetings(ctx, field) - case "core_flags": - return ec.fieldContext_Section_core_flags(ctx, field) - case "syllabus_uri": - return ec.fieldContext_Section_syllabus_uri(ctx, field) - case "grade_distribution": - return ec.fieldContext_Section_grade_distribution(ctx, field) - case "attributes": - return ec.fieldContext_Section_attributes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Section", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_section_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_professorByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_professorByID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ProfessorByID(rctx, fc.Args["id"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Professor) - fc.Result = res - return ec.marshalNProfessor2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessor(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_professorByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Professor__id(ctx, field) - case "first_name": - return ec.fieldContext_Professor_first_name(ctx, field) - case "last_name": - return ec.fieldContext_Professor_last_name(ctx, field) - case "titles": - return ec.fieldContext_Professor_titles(ctx, field) - case "email": - return ec.fieldContext_Professor_email(ctx, field) - case "phone_number": - return ec.fieldContext_Professor_phone_number(ctx, field) - case "office": - return ec.fieldContext_Professor_office(ctx, field) - case "profile_uri": - return ec.fieldContext_Professor_profile_uri(ctx, field) - case "image_uri": - return ec.fieldContext_Professor_image_uri(ctx, field) - case "office_hours": - return ec.fieldContext_Professor_office_hours(ctx, field) - case "sections": - return ec.fieldContext_Professor_sections(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Professor", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_professorByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_professor(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_professor(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Professor(rctx, fc.Args["first_name"].(*string), fc.Args["last_name"].(*string), fc.Args["titles"].([]string), fc.Args["email"].(*string), fc.Args["phone_number"].(*string), fc.Args["profile_uri"].(*string), fc.Args["image_uri"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Professor) - fc.Result = res - return ec.marshalNProfessor2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessorᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_professor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Professor__id(ctx, field) - case "first_name": - return ec.fieldContext_Professor_first_name(ctx, field) - case "last_name": - return ec.fieldContext_Professor_last_name(ctx, field) - case "titles": - return ec.fieldContext_Professor_titles(ctx, field) - case "email": - return ec.fieldContext_Professor_email(ctx, field) - case "phone_number": - return ec.fieldContext_Professor_phone_number(ctx, field) - case "office": - return ec.fieldContext_Professor_office(ctx, field) - case "profile_uri": - return ec.fieldContext_Professor_profile_uri(ctx, field) - case "image_uri": - return ec.fieldContext_Professor_image_uri(ctx, field) - case "office_hours": - return ec.fieldContext_Professor_office_hours(ctx, field) - case "sections": - return ec.fieldContext_Professor_sections(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Professor", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_professor_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_examByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_examByID(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().ExamByID(rctx, fc.Args["id"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(model.Exam) - fc.Result = res - return ec.marshalNExam2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐExam(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_examByID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_examByID_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query_exam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_exam(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Exam(rctx, fc.Args["type"].(*string), fc.Args["name"].(*string), fc.Args["level"].(*string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]model.Exam) - fc.Result = res - return ec.marshalNExam2ᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐExamᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query_exam(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("FieldContext.Child cannot be called on type INTERFACE") - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query_exam_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectType(fc.Args["name"].(string)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query___type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Query___type_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query___schema(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.introspectSchema() - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Schema) - fc.Result = res - return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Query___schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Query", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "description": - return ec.fieldContext___Schema_description(ctx, field) - case "types": - return ec.fieldContext___Schema_types(ctx, field) - case "queryType": - return ec.fieldContext___Schema_queryType(ctx, field) - case "mutationType": - return ec.fieldContext___Schema_mutationType(ctx, field) - case "subscriptionType": - return ec.fieldContext___Schema_subscriptionType(ctx, field) - case "directives": - return ec.fieldContext___Schema_directives(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Schema", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section__id(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section__id(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section__id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type ID does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_section_number(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_section_number(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SectionNumber, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_section_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_course_reference(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_course_reference(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Section().CourseReference(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Course) - fc.Result = res - return ec.marshalNCourse2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourse(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_course_reference(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Course__id(ctx, field) - case "course_number": - return ec.fieldContext_Course_course_number(ctx, field) - case "subject_prefix": - return ec.fieldContext_Course_subject_prefix(ctx, field) - case "title": - return ec.fieldContext_Course_title(ctx, field) - case "description": - return ec.fieldContext_Course_description(ctx, field) - case "enrollment_reqs": - return ec.fieldContext_Course_enrollment_reqs(ctx, field) - case "school": - return ec.fieldContext_Course_school(ctx, field) - case "credit_hours": - return ec.fieldContext_Course_credit_hours(ctx, field) - case "class_level": - return ec.fieldContext_Course_class_level(ctx, field) - case "activity_type": - return ec.fieldContext_Course_activity_type(ctx, field) - case "grading": - return ec.fieldContext_Course_grading(ctx, field) - case "internal_course_number": - return ec.fieldContext_Course_internal_course_number(ctx, field) - case "prerequisites": - return ec.fieldContext_Course_prerequisites(ctx, field) - case "corequisites": - return ec.fieldContext_Course_corequisites(ctx, field) - case "co_or_pre_requisites": - return ec.fieldContext_Course_co_or_pre_requisites(ctx, field) - case "sections": - return ec.fieldContext_Course_sections(ctx, field) - case "lecture_contact_hours": - return ec.fieldContext_Course_lecture_contact_hours(ctx, field) - case "laboratory_contact_hours": - return ec.fieldContext_Course_laboratory_contact_hours(ctx, field) - case "offering_frequency": - return ec.fieldContext_Course_offering_frequency(ctx, field) - case "catalog_year": - return ec.fieldContext_Course_catalog_year(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Course", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_section_corequisites(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_section_corequisites(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SectionCorequisites, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.CollectionRequirement) - fc.Result = res - return ec.marshalNCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_section_corequisites(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_CollectionRequirement_name(ctx, field) - case "required": - return ec.fieldContext_CollectionRequirement_required(ctx, field) - case "options": - return ec.fieldContext_CollectionRequirement_options(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type CollectionRequirement", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_academic_session(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_academic_session(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.AcademicSession, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.AcademicSession) - fc.Result = res - return ec.marshalNAcademicSession2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAcademicSession(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_academic_session(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext_AcademicSession_name(ctx, field) - case "start_date": - return ec.fieldContext_AcademicSession_start_date(ctx, field) - case "end_date": - return ec.fieldContext_AcademicSession_end_date(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type AcademicSession", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_professors(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_professors(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Section().Professors(rctx, obj) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Professor) - fc.Result = res - return ec.marshalNProfessor2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessorᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_professors(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: true, - IsResolver: true, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Professor__id(ctx, field) - case "first_name": - return ec.fieldContext_Professor_first_name(ctx, field) - case "last_name": - return ec.fieldContext_Professor_last_name(ctx, field) - case "titles": - return ec.fieldContext_Professor_titles(ctx, field) - case "email": - return ec.fieldContext_Professor_email(ctx, field) - case "phone_number": - return ec.fieldContext_Professor_phone_number(ctx, field) - case "office": - return ec.fieldContext_Professor_office(ctx, field) - case "profile_uri": - return ec.fieldContext_Professor_profile_uri(ctx, field) - case "image_uri": - return ec.fieldContext_Professor_image_uri(ctx, field) - case "office_hours": - return ec.fieldContext_Professor_office_hours(ctx, field) - case "sections": - return ec.fieldContext_Professor_sections(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Professor", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_teaching_assistants(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_teaching_assistants(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TeachingAssistants, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Assistant) - fc.Result = res - return ec.marshalNAssistant2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAssistantᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_teaching_assistants(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "first_name": - return ec.fieldContext_Assistant_first_name(ctx, field) - case "last_name": - return ec.fieldContext_Assistant_last_name(ctx, field) - case "role": - return ec.fieldContext_Assistant_role(ctx, field) - case "email": - return ec.fieldContext_Assistant_email(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Assistant", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_internal_class_number(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_internal_class_number(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InternalClassNumber, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_internal_class_number(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_instruction_mode(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_instruction_mode(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InstructionMode, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_instruction_mode(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_meetings(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_meetings(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Meetings, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]*model.Meeting) - fc.Result = res - return ec.marshalNMeeting2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐMeetingᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_meetings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "start_date": - return ec.fieldContext_Meeting_start_date(ctx, field) - case "end_date": - return ec.fieldContext_Meeting_end_date(ctx, field) - case "meeting_days": - return ec.fieldContext_Meeting_meeting_days(ctx, field) - case "start_time": - return ec.fieldContext_Meeting_start_time(ctx, field) - case "end_time": - return ec.fieldContext_Meeting_end_time(ctx, field) - case "modality": - return ec.fieldContext_Meeting_modality(ctx, field) - case "location": - return ec.fieldContext_Meeting_location(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Meeting", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_core_flags(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_core_flags(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.CoreFlags, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_core_flags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_syllabus_uri(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_syllabus_uri(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SyllabusURI, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_syllabus_uri(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_grade_distribution(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_grade_distribution(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.GradeDistribution, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]int) - fc.Result = res - return ec.marshalNInt2ᚕintᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_grade_distribution(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Int does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) _Section_attributes(ctx context.Context, field graphql.CollectedField, obj *model.Section) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Section_attributes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Attributes, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Attributes) - fc.Result = res - return ec.marshalNAttributes2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAttributes(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_Section_attributes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Section", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "raw_attributes": - return ec.fieldContext_Attributes_raw_attributes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Attributes", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) _SectionRequirement_section_reference(ctx context.Context, field graphql.CollectedField, obj *model.SectionRequirement) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_SectionRequirement_section_reference(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SectionReference, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*model.Section) - fc.Result = res - return ec.marshalNSection2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSection(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext_SectionRequirement_section_reference(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "SectionRequirement", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "_id": - return ec.fieldContext_Section__id(ctx, field) - case "section_number": - return ec.fieldContext_Section_section_number(ctx, field) - case "course_reference": - return ec.fieldContext_Section_course_reference(ctx, field) - case "section_corequisites": - return ec.fieldContext_Section_section_corequisites(ctx, field) - case "academic_session": - return ec.fieldContext_Section_academic_session(ctx, field) - case "professors": - return ec.fieldContext_Section_professors(ctx, field) - case "teaching_assistants": - return ec.fieldContext_Section_teaching_assistants(ctx, field) - case "internal_class_number": - return ec.fieldContext_Section_internal_class_number(ctx, field) - case "instruction_mode": - return ec.fieldContext_Section_instruction_mode(ctx, field) - case "meetings": - return ec.fieldContext_Section_meetings(ctx, field) - case "core_flags": - return ec.fieldContext_Section_core_flags(ctx, field) - case "syllabus_uri": - return ec.fieldContext_Section_syllabus_uri(ctx, field) - case "grade_distribution": - return ec.fieldContext_Section_grade_distribution(ctx, field) - case "attributes": - return ec.fieldContext_Section_attributes(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Section", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_locations(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Locations, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_locations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __DirectiveLocation does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_args(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Directive_isRepeatable(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Directive", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_isDeprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___EnumValue_deprecationReason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__EnumValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_args(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Args, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_args(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_isDeprecated(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_isDeprecated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type Boolean does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Field_deprecationReason(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Field_deprecationReason(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Field", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_type(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Type, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___InputValue_defaultValue(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__InputValue", - Field: field, - IsMethod: false, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_types(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Types(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_types(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_queryType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_queryType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_mutationType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_mutationType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_subscriptionType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Schema_directives(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.([]introspection.Directive) - fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Schema_directives(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Schema", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Directive_name(ctx, field) - case "description": - return ec.fieldContext___Directive_description(ctx, field) - case "locations": - return ec.fieldContext___Directive_locations(ctx, field) - case "args": - return ec.fieldContext___Directive_args(ctx, field) - case "isRepeatable": - return ec.fieldContext___Directive_isRepeatable(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Directive", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_kind(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_kind(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type __TypeKind does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_name(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Name(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_description(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Description(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_fields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Fields(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Field) - fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_fields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___Field_name(ctx, field) - case "description": - return ec.fieldContext___Field_description(ctx, field) - case "args": - return ec.fieldContext___Field_args(ctx, field) - case "type": - return ec.fieldContext___Field_type(ctx, field) - case "isDeprecated": - return ec.fieldContext___Field_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___Field_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Field", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_fields_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_interfaces(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_interfaces(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_possibleTypes(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_enumValues(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.EnumValues(fc.Args["includeDeprecated"].(bool)), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.EnumValue) - fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_enumValues(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___EnumValue_name(ctx, field) - case "description": - return ec.fieldContext___EnumValue_description(ctx, field) - case "isDeprecated": - return ec.fieldContext___EnumValue_isDeprecated(ctx, field) - case "deprecationReason": - return ec.fieldContext___EnumValue_deprecationReason(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __EnumValue", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) - } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field___Type_enumValues_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} - -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_inputFields(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_inputFields(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "name": - return ec.fieldContext___InputValue_name(ctx, field) - case "description": - return ec.fieldContext___InputValue_description(ctx, field) - case "type": - return ec.fieldContext___InputValue_type(ctx, field) - case "defaultValue": - return ec.fieldContext___InputValue_defaultValue(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __InputValue", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_ofType(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*introspection.Type) - fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_ofType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "kind": - return ec.fieldContext___Type_kind(ctx, field) - case "name": - return ec.fieldContext___Type_name(ctx, field) - case "description": - return ec.fieldContext___Type_description(ctx, field) - case "fields": - return ec.fieldContext___Type_fields(ctx, field) - case "interfaces": - return ec.fieldContext___Type_interfaces(ctx, field) - case "possibleTypes": - return ec.fieldContext___Type_possibleTypes(ctx, field) - case "enumValues": - return ec.fieldContext___Type_enumValues(ctx, field) - case "inputFields": - return ec.fieldContext___Type_inputFields(ctx, field) - case "ofType": - return ec.fieldContext___Type_ofType(ctx, field) - case "specifiedByURL": - return ec.fieldContext___Type_specifiedByURL(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} - -func (ec *executionContext) ___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { - fc, err := ec.fieldContext___Type_specifiedByURL(ctx, field) - if err != nil { - return graphql.Null - } - ctx = graphql.WithFieldContext(ctx, fc) - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SpecifiedByURL(), nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) fieldContext___Type_specifiedByURL(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "__Type", - Field: field, - IsMethod: true, - IsResolver: false, - Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type String does not have child fields") - }, - } - return fc, nil -} - -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -func (ec *executionContext) _Exam(ctx context.Context, sel ast.SelectionSet, obj model.Exam) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.APExam: - return ec._APExam(ctx, sel, &obj) - case *model.APExam: - if obj == nil { - return graphql.Null - } - return ec._APExam(ctx, sel, obj) - case model.ALEKSExam: - return ec._ALEKSExam(ctx, sel, &obj) - case *model.ALEKSExam: - if obj == nil { - return graphql.Null - } - return ec._ALEKSExam(ctx, sel, obj) - case model.CLEPExam: - return ec._CLEPExam(ctx, sel, &obj) - case *model.CLEPExam: - if obj == nil { - return graphql.Null - } - return ec._CLEPExam(ctx, sel, obj) - case model.IBExam: - return ec._IBExam(ctx, sel, &obj) - case *model.IBExam: - if obj == nil { - return graphql.Null - } - return ec._IBExam(ctx, sel, obj) - case model.CSPlacementExam: - return ec._CSPlacementExam(ctx, sel, &obj) - case *model.CSPlacementExam: - if obj == nil { - return graphql.Null - } - return ec._CSPlacementExam(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) - } -} - -func (ec *executionContext) _Outcome(ctx context.Context, sel ast.SelectionSet, obj model.Outcome) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.Course: - return ec._Course(ctx, sel, &obj) - case *model.Course: - if obj == nil { - return graphql.Null - } - return ec._Course(ctx, sel, obj) - case model.Credit: - return ec._Credit(ctx, sel, &obj) - case *model.Credit: - if obj == nil { - return graphql.Null - } - return ec._Credit(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) - } -} - -func (ec *executionContext) _Requirement(ctx context.Context, sel ast.SelectionSet, obj model.Requirement) graphql.Marshaler { - switch obj := (obj).(type) { - case nil: - return graphql.Null - case model.CourseRequirement: - return ec._CourseRequirement(ctx, sel, &obj) - case *model.CourseRequirement: - if obj == nil { - return graphql.Null - } - return ec._CourseRequirement(ctx, sel, obj) - case model.SectionRequirement: - return ec._SectionRequirement(ctx, sel, &obj) - case *model.SectionRequirement: - if obj == nil { - return graphql.Null - } - return ec._SectionRequirement(ctx, sel, obj) - case model.ExamRequirement: - return ec._ExamRequirement(ctx, sel, &obj) - case *model.ExamRequirement: - if obj == nil { - return graphql.Null - } - return ec._ExamRequirement(ctx, sel, obj) - case model.MajorRequirement: - return ec._MajorRequirement(ctx, sel, &obj) - case *model.MajorRequirement: - if obj == nil { - return graphql.Null - } - return ec._MajorRequirement(ctx, sel, obj) - case model.MinorRequirement: - return ec._MinorRequirement(ctx, sel, &obj) - case *model.MinorRequirement: - if obj == nil { - return graphql.Null - } - return ec._MinorRequirement(ctx, sel, obj) - case model.GPARequirement: - return ec._GPARequirement(ctx, sel, &obj) - case *model.GPARequirement: - if obj == nil { - return graphql.Null - } - return ec._GPARequirement(ctx, sel, obj) - case model.ConsentRequirement: - return ec._ConsentRequirement(ctx, sel, &obj) - case *model.ConsentRequirement: - if obj == nil { - return graphql.Null - } - return ec._ConsentRequirement(ctx, sel, obj) - case model.CollectionRequirement: - return ec._CollectionRequirement(ctx, sel, &obj) - case *model.CollectionRequirement: - if obj == nil { - return graphql.Null - } - return ec._CollectionRequirement(ctx, sel, obj) - case model.HoursRequirement: - return ec._HoursRequirement(ctx, sel, &obj) - case *model.HoursRequirement: - if obj == nil { - return graphql.Null - } - return ec._HoursRequirement(ctx, sel, obj) - case model.OtherRequirement: - return ec._OtherRequirement(ctx, sel, &obj) - case *model.OtherRequirement: - if obj == nil { - return graphql.Null - } - return ec._OtherRequirement(ctx, sel, obj) - case model.ChoiceRequirement: - return ec._ChoiceRequirement(ctx, sel, &obj) - case *model.ChoiceRequirement: - if obj == nil { - return graphql.Null - } - return ec._ChoiceRequirement(ctx, sel, obj) - case model.LimitRequirement: - return ec._LimitRequirement(ctx, sel, &obj) - case *model.LimitRequirement: - if obj == nil { - return graphql.Null - } - return ec._LimitRequirement(ctx, sel, obj) - case model.CoreRequirement: - return ec._CoreRequirement(ctx, sel, &obj) - case *model.CoreRequirement: - if obj == nil { - return graphql.Null - } - return ec._CoreRequirement(ctx, sel, obj) - default: - panic(fmt.Errorf("unexpected type %T", obj)) - } -} - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var aLEKSExamImplementors = []string{"ALEKSExam", "Exam"} - -func (ec *executionContext) _ALEKSExam(ctx context.Context, sel ast.SelectionSet, obj *model.ALEKSExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, aLEKSExamImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ALEKSExam") - case "_id": - - out.Values[i] = ec._ALEKSExam__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "placement": - - out.Values[i] = ec._ALEKSExam_placement(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var aPExamImplementors = []string{"APExam", "Exam"} - -func (ec *executionContext) _APExam(ctx context.Context, sel ast.SelectionSet, obj *model.APExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, aPExamImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("APExam") - case "_id": - - out.Values[i] = ec._APExam__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - - out.Values[i] = ec._APExam_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "yields": - - out.Values[i] = ec._APExam_yields(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var academicSessionImplementors = []string{"AcademicSession"} - -func (ec *executionContext) _AcademicSession(ctx context.Context, sel ast.SelectionSet, obj *model.AcademicSession) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, academicSessionImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("AcademicSession") - case "name": - - out.Values[i] = ec._AcademicSession_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "start_date": - - out.Values[i] = ec._AcademicSession_start_date(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "end_date": - - out.Values[i] = ec._AcademicSession_end_date(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var assistantImplementors = []string{"Assistant"} - -func (ec *executionContext) _Assistant(ctx context.Context, sel ast.SelectionSet, obj *model.Assistant) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, assistantImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Assistant") - case "first_name": - - out.Values[i] = ec._Assistant_first_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "last_name": - - out.Values[i] = ec._Assistant_last_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "role": - - out.Values[i] = ec._Assistant_role(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "email": - - out.Values[i] = ec._Assistant_email(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var attributesImplementors = []string{"Attributes"} - -func (ec *executionContext) _Attributes(ctx context.Context, sel ast.SelectionSet, obj *model.Attributes) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, attributesImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Attributes") - case "raw_attributes": - - out.Values[i] = ec._Attributes_raw_attributes(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var cLEPExamImplementors = []string{"CLEPExam", "Exam"} - -func (ec *executionContext) _CLEPExam(ctx context.Context, sel ast.SelectionSet, obj *model.CLEPExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cLEPExamImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CLEPExam") - case "_id": - - out.Values[i] = ec._CLEPExam__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - - out.Values[i] = ec._CLEPExam_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "yields": - - out.Values[i] = ec._CLEPExam_yields(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var cSPlacementExamImplementors = []string{"CSPlacementExam", "Exam"} - -func (ec *executionContext) _CSPlacementExam(ctx context.Context, sel ast.SelectionSet, obj *model.CSPlacementExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, cSPlacementExamImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CSPlacementExam") - case "_id": - - out.Values[i] = ec._CSPlacementExam__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "yields": - - out.Values[i] = ec._CSPlacementExam_yields(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var choiceRequirementImplementors = []string{"ChoiceRequirement", "Requirement"} - -func (ec *executionContext) _ChoiceRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.ChoiceRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, choiceRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ChoiceRequirement") - case "choices": - - out.Values[i] = ec._ChoiceRequirement_choices(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var collectionRequirementImplementors = []string{"CollectionRequirement", "Requirement"} - -func (ec *executionContext) _CollectionRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.CollectionRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, collectionRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CollectionRequirement") - case "name": - - out.Values[i] = ec._CollectionRequirement_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "required": - - out.Values[i] = ec._CollectionRequirement_required(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "options": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CollectionRequirement_options(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var consentRequirementImplementors = []string{"ConsentRequirement", "Requirement"} - -func (ec *executionContext) _ConsentRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.ConsentRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, consentRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ConsentRequirement") - case "granter": - - out.Values[i] = ec._ConsentRequirement_granter(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var coreRequirementImplementors = []string{"CoreRequirement", "Requirement"} - -func (ec *executionContext) _CoreRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.CoreRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, coreRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CoreRequirement") - case "core_flag": - - out.Values[i] = ec._CoreRequirement_core_flag(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "hours": - - out.Values[i] = ec._CoreRequirement_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var courseImplementors = []string{"Course", "Outcome"} - -func (ec *executionContext) _Course(ctx context.Context, sel ast.SelectionSet, obj *model.Course) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, courseImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Course") - case "_id": - - out.Values[i] = ec._Course__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "course_number": - - out.Values[i] = ec._Course_course_number(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "subject_prefix": - - out.Values[i] = ec._Course_subject_prefix(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "title": - - out.Values[i] = ec._Course_title(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "description": - - out.Values[i] = ec._Course_description(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "enrollment_reqs": - - out.Values[i] = ec._Course_enrollment_reqs(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "school": - - out.Values[i] = ec._Course_school(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "credit_hours": - - out.Values[i] = ec._Course_credit_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "class_level": - - out.Values[i] = ec._Course_class_level(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "activity_type": - - out.Values[i] = ec._Course_activity_type(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "grading": - - out.Values[i] = ec._Course_grading(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "internal_course_number": - - out.Values[i] = ec._Course_internal_course_number(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "prerequisites": - - out.Values[i] = ec._Course_prerequisites(ctx, field, obj) - - case "corequisites": - - out.Values[i] = ec._Course_corequisites(ctx, field, obj) - - case "co_or_pre_requisites": - - out.Values[i] = ec._Course_co_or_pre_requisites(ctx, field, obj) - - case "sections": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Course_sections(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "lecture_contact_hours": - - out.Values[i] = ec._Course_lecture_contact_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "laboratory_contact_hours": - - out.Values[i] = ec._Course_laboratory_contact_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "offering_frequency": - - out.Values[i] = ec._Course_offering_frequency(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "catalog_year": - - out.Values[i] = ec._Course_catalog_year(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var courseRequirementImplementors = []string{"CourseRequirement", "Requirement"} - -func (ec *executionContext) _CourseRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.CourseRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, courseRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("CourseRequirement") - case "class_reference": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._CourseRequirement_class_reference(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "minimum_grade": - - out.Values[i] = ec._CourseRequirement_minimum_grade(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var creditImplementors = []string{"Credit", "Outcome"} - -func (ec *executionContext) _Credit(ctx context.Context, sel ast.SelectionSet, obj *model.Credit) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, creditImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Credit") - case "category": - - out.Values[i] = ec._Credit_category(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "credit_hours": - - out.Values[i] = ec._Credit_credit_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var examRequirementImplementors = []string{"ExamRequirement", "Requirement"} - -func (ec *executionContext) _ExamRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.ExamRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, examRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ExamRequirement") - case "exam_reference": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._ExamRequirement_exam_reference(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "minimum_score": - - out.Values[i] = ec._ExamRequirement_minimum_score(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var gPARequirementImplementors = []string{"GPARequirement", "Requirement"} - -func (ec *executionContext) _GPARequirement(ctx context.Context, sel ast.SelectionSet, obj *model.GPARequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, gPARequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("GPARequirement") - case "minimum": - - out.Values[i] = ec._GPARequirement_minimum(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "subset": - - out.Values[i] = ec._GPARequirement_subset(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var hoursRequirementImplementors = []string{"HoursRequirement", "Requirement"} - -func (ec *executionContext) _HoursRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.HoursRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, hoursRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("HoursRequirement") - case "required": - - out.Values[i] = ec._HoursRequirement_required(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "options": - - out.Values[i] = ec._HoursRequirement_options(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var iBExamImplementors = []string{"IBExam", "Exam"} - -func (ec *executionContext) _IBExam(ctx context.Context, sel ast.SelectionSet, obj *model.IBExam) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, iBExamImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("IBExam") - case "_id": - - out.Values[i] = ec._IBExam__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - - out.Values[i] = ec._IBExam_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "level": - - out.Values[i] = ec._IBExam_level(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "yields": - - out.Values[i] = ec._IBExam_yields(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var limitRequirementImplementors = []string{"LimitRequirement", "Requirement"} - -func (ec *executionContext) _LimitRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.LimitRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, limitRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("LimitRequirement") - case "max_hours": - - out.Values[i] = ec._LimitRequirement_max_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var locationImplementors = []string{"Location"} - -func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, obj *model.Location) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, locationImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Location") - case "building": - - out.Values[i] = ec._Location_building(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "room": - - out.Values[i] = ec._Location_room(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "map_uri": - - out.Values[i] = ec._Location_map_uri(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var majorRequirementImplementors = []string{"MajorRequirement", "Requirement"} - -func (ec *executionContext) _MajorRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.MajorRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, majorRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("MajorRequirement") - case "major": - - out.Values[i] = ec._MajorRequirement_major(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var meetingImplementors = []string{"Meeting"} - -func (ec *executionContext) _Meeting(ctx context.Context, sel ast.SelectionSet, obj *model.Meeting) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, meetingImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Meeting") - case "start_date": - - out.Values[i] = ec._Meeting_start_date(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "end_date": - - out.Values[i] = ec._Meeting_end_date(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "meeting_days": - - out.Values[i] = ec._Meeting_meeting_days(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "start_time": - - out.Values[i] = ec._Meeting_start_time(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "end_time": - - out.Values[i] = ec._Meeting_end_time(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "modality": - - out.Values[i] = ec._Meeting_modality(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "location": - - out.Values[i] = ec._Meeting_location(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var minorRequirementImplementors = []string{"MinorRequirement", "Requirement"} - -func (ec *executionContext) _MinorRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.MinorRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, minorRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("MinorRequirement") - case "minor": - - out.Values[i] = ec._MinorRequirement_minor(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var otherRequirementImplementors = []string{"OtherRequirement", "Requirement"} - -func (ec *executionContext) _OtherRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.OtherRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, otherRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("OtherRequirement") - case "description": - - out.Values[i] = ec._OtherRequirement_description(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "condition": - - out.Values[i] = ec._OtherRequirement_condition(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var possibleOutcomesImplementors = []string{"PossibleOutcomes"} - -func (ec *executionContext) _PossibleOutcomes(ctx context.Context, sel ast.SelectionSet, obj *model.PossibleOutcomes) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, possibleOutcomesImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("PossibleOutcomes") - case "requirement": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._PossibleOutcomes_requirement(ctx, field, obj) - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "possible_outcomes": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._PossibleOutcomes_possible_outcomes(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var professorImplementors = []string{"Professor"} - -func (ec *executionContext) _Professor(ctx context.Context, sel ast.SelectionSet, obj *model.Professor) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, professorImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Professor") - case "_id": - - out.Values[i] = ec._Professor__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "first_name": - - out.Values[i] = ec._Professor_first_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "last_name": - - out.Values[i] = ec._Professor_last_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "titles": - - out.Values[i] = ec._Professor_titles(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "email": - - out.Values[i] = ec._Professor_email(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "phone_number": - - out.Values[i] = ec._Professor_phone_number(ctx, field, obj) - - case "office": - - out.Values[i] = ec._Professor_office(ctx, field, obj) - - case "profile_uri": - - out.Values[i] = ec._Professor_profile_uri(ctx, field, obj) - - case "image_uri": - - out.Values[i] = ec._Professor_image_uri(ctx, field, obj) - - case "office_hours": - - out.Values[i] = ec._Professor_office_hours(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "sections": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Professor_sections(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var queryImplementors = []string{"Query"} - -func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Query", - }) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) - - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "courseByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_courseByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "course": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_course(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "sectionByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_sectionByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "section": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_section(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "professorByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_professorByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "professor": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_professor(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "examByID": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_examByID(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "exam": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_exam(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, innerFunc) - } - - out.Concurrently(i, func() graphql.Marshaler { - return rrm(innerCtx) - }) - case "__type": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) - }) - - case "__schema": - - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - }) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var sectionImplementors = []string{"Section"} - -func (ec *executionContext) _Section(ctx context.Context, sel ast.SelectionSet, obj *model.Section) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, sectionImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Section") - case "_id": - - out.Values[i] = ec._Section__id(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "section_number": - - out.Values[i] = ec._Section_section_number(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "course_reference": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Section_course_reference(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "section_corequisites": - - out.Values[i] = ec._Section_section_corequisites(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "academic_session": - - out.Values[i] = ec._Section_academic_session(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "professors": - field := field - - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Section_professors(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } - - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) - - }) - case "teaching_assistants": - - out.Values[i] = ec._Section_teaching_assistants(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "internal_class_number": - - out.Values[i] = ec._Section_internal_class_number(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "instruction_mode": - - out.Values[i] = ec._Section_instruction_mode(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "meetings": - - out.Values[i] = ec._Section_meetings(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "core_flags": - - out.Values[i] = ec._Section_core_flags(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "syllabus_uri": - - out.Values[i] = ec._Section_syllabus_uri(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "grade_distribution": - - out.Values[i] = ec._Section_grade_distribution(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "attributes": - - out.Values[i] = ec._Section_attributes(ctx, field, obj) - - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var sectionRequirementImplementors = []string{"SectionRequirement", "Requirement"} - -func (ec *executionContext) _SectionRequirement(ctx context.Context, sel ast.SelectionSet, obj *model.SectionRequirement) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, sectionRequirementImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("SectionRequirement") - case "section_reference": - - out.Values[i] = ec._SectionRequirement_section_reference(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __DirectiveImplementors = []string{"__Directive"} - -func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Directive") - case "name": - - out.Values[i] = ec.___Directive_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Directive_description(ctx, field, obj) - - case "locations": - - out.Values[i] = ec.___Directive_locations(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "args": - - out.Values[i] = ec.___Directive_args(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isRepeatable": - - out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __EnumValueImplementors = []string{"__EnumValue"} - -func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__EnumValue") - case "name": - - out.Values[i] = ec.___EnumValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___EnumValue_description(ctx, field, obj) - - case "isDeprecated": - - out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - - out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __FieldImplementors = []string{"__Field"} - -func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Field") - case "name": - - out.Values[i] = ec.___Field_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___Field_description(ctx, field, obj) - - case "args": - - out.Values[i] = ec.___Field_args(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "type": - - out.Values[i] = ec.___Field_type(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "isDeprecated": - - out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "deprecationReason": - - out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __InputValueImplementors = []string{"__InputValue"} - -func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__InputValue") - case "name": - - out.Values[i] = ec.___InputValue_name(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "description": - - out.Values[i] = ec.___InputValue_description(ctx, field, obj) - - case "type": - - out.Values[i] = ec.___InputValue_type(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "defaultValue": - - out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __SchemaImplementors = []string{"__Schema"} - -func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Schema") - case "description": - - out.Values[i] = ec.___Schema_description(ctx, field, obj) - - case "types": - - out.Values[i] = ec.___Schema_types(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "queryType": - - out.Values[i] = ec.___Schema_queryType(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "mutationType": - - out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) - - case "subscriptionType": - - out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) - - case "directives": - - out.Values[i] = ec.___Schema_directives(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var __TypeImplementors = []string{"__Type"} - -func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("__Type") - case "kind": - - out.Values[i] = ec.___Type_kind(ctx, field, obj) - - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - - out.Values[i] = ec.___Type_name(ctx, field, obj) - - case "description": - - out.Values[i] = ec.___Type_description(ctx, field, obj) - - case "fields": - - out.Values[i] = ec.___Type_fields(ctx, field, obj) - - case "interfaces": - - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) - - case "possibleTypes": - - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) - - case "enumValues": - - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) - - case "inputFields": - - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) - - case "ofType": - - out.Values[i] = ec.___Type_ofType(ctx, field, obj) - - case "specifiedByURL": - - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) - - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) marshalNAcademicSession2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAcademicSession(ctx context.Context, sel ast.SelectionSet, v *model.AcademicSession) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._AcademicSession(ctx, sel, v) -} - -func (ec *executionContext) marshalNAssistant2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAssistantᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Assistant) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNAssistant2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAssistant(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNAssistant2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAssistant(ctx context.Context, sel ast.SelectionSet, v *model.Assistant) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Assistant(ctx, sel, v) -} - -func (ec *executionContext) marshalNAttributes2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐAttributes(ctx context.Context, sel ast.SelectionSet, v *model.Attributes) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Attributes(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) marshalNCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx context.Context, sel ast.SelectionSet, v *model.CollectionRequirement) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._CollectionRequirement(ctx, sel, v) -} - -func (ec *executionContext) marshalNCourse2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourse(ctx context.Context, sel ast.SelectionSet, v model.Course) graphql.Marshaler { - return ec._Course(ctx, sel, &v) -} - -func (ec *executionContext) marshalNCourse2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourseᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Course) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNCourse2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourse(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNCourse2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourse(ctx context.Context, sel ast.SelectionSet, v *model.Course) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Course(ctx, sel, v) -} - -func (ec *executionContext) marshalNCourseRequirement2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourseRequirementᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.CourseRequirement) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNCourseRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourseRequirement(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNCourseRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCourseRequirement(ctx context.Context, sel ast.SelectionSet, v *model.CourseRequirement) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._CourseRequirement(ctx, sel, v) -} - -func (ec *executionContext) marshalNExam2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐExam(ctx context.Context, sel ast.SelectionSet, v model.Exam) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Exam(ctx, sel, v) -} - -func (ec *executionContext) marshalNExam2ᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐExamᚄ(ctx context.Context, sel ast.SelectionSet, v []model.Exam) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNExam2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐExam(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { - res, err := graphql.UnmarshalFloatContext(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { - res := graphql.MarshalFloatContext(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return graphql.WrapContextMarshaler(ctx, res) -} - -func (ec *executionContext) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalID(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalID(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { - res, err := graphql.UnmarshalInt(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { - res := graphql.MarshalInt(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNInt2ᚕintᚄ(ctx context.Context, v interface{}) ([]int, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]int, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNInt2int(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalNInt2ᚕintᚄ(ctx context.Context, sel ast.SelectionSet, v []int) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalNInt2int(ctx, sel, v[i]) - } - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNLocation2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐLocation(ctx context.Context, sel ast.SelectionSet, v *model.Location) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Location(ctx, sel, v) -} - -func (ec *executionContext) marshalNMeeting2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐMeetingᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Meeting) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNMeeting2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐMeeting(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNMeeting2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐMeeting(ctx context.Context, sel ast.SelectionSet, v *model.Meeting) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Meeting(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNModalityType2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐModalityType(ctx context.Context, v interface{}) (model.ModalityType, error) { - var res model.ModalityType - err := res.UnmarshalGQL(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNModalityType2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐModalityType(ctx context.Context, sel ast.SelectionSet, v model.ModalityType) graphql.Marshaler { - return v -} - -func (ec *executionContext) marshalNOutcome2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐOutcome(ctx context.Context, sel ast.SelectionSet, v model.Outcome) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Outcome(ctx, sel, v) -} - -func (ec *executionContext) marshalNOutcome2ᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐOutcomeᚄ(ctx context.Context, sel ast.SelectionSet, v []model.Outcome) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNOutcome2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐOutcome(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNOutcome2ᚕᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐOutcomeᚄ(ctx context.Context, sel ast.SelectionSet, v [][]model.Outcome) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNOutcome2ᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐOutcomeᚄ(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNPossibleOutcomes2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomesᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.PossibleOutcomes) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNPossibleOutcomes2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomes(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNPossibleOutcomes2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐPossibleOutcomes(ctx context.Context, sel ast.SelectionSet, v *model.PossibleOutcomes) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._PossibleOutcomes(ctx, sel, v) -} - -func (ec *executionContext) marshalNProfessor2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessor(ctx context.Context, sel ast.SelectionSet, v model.Professor) graphql.Marshaler { - return ec._Professor(ctx, sel, &v) -} - -func (ec *executionContext) marshalNProfessor2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessorᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Professor) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNProfessor2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessor(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNProfessor2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐProfessor(ctx context.Context, sel ast.SelectionSet, v *model.Professor) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Professor(ctx, sel, v) -} - -func (ec *executionContext) marshalNRequirement2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐRequirement(ctx context.Context, sel ast.SelectionSet, v model.Requirement) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Requirement(ctx, sel, v) -} - -func (ec *executionContext) marshalNRequirement2ᚕgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐRequirementᚄ(ctx context.Context, sel ast.SelectionSet, v []model.Requirement) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNRequirement2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐRequirement(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNSection2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSection(ctx context.Context, sel ast.SelectionSet, v model.Section) graphql.Marshaler { - return ec._Section(ctx, sel, &v) -} - -func (ec *executionContext) marshalNSection2ᚕᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSectionᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Section) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNSection2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSection(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalNSection2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐSection(ctx context.Context, sel ast.SelectionSet, v *model.Section) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec._Section(ctx, sel, v) -} - -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalNString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]string, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalNString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalNString2string(ctx, sel, v[i]) - } - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { - return ec.___Directive(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]string, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { - return ec.___EnumValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { - return ec.___Field(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { - return ec.___InputValue(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { - return ec.___Type(ctx, sel, &v) -} - -func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { - res := graphql.MarshalString(v) - if res == graphql.Null { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "the requested element is null which the schema does not allow") - } - } - return res -} - -func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { - res, err := graphql.UnmarshalBoolean(v) - return res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { - res := graphql.MarshalBoolean(v) - return res -} - -func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalBoolean(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalBoolean(*v) - return res -} - -func (ec *executionContext) marshalOCollectionRequirement2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐCollectionRequirement(ctx context.Context, sel ast.SelectionSet, v *model.CollectionRequirement) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._CollectionRequirement(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOID2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalID(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOID2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalID(*v) - return res -} - -func (ec *executionContext) marshalOLocation2ᚖgithubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐLocation(ctx context.Context, sel ast.SelectionSet, v *model.Location) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Location(ctx, sel, v) -} - -func (ec *executionContext) marshalORequirement2githubᚗcomᚋLocatingWizardᚋnebula_api_graphqlᚋgraphᚋmodelᚐRequirement(ctx context.Context, sel ast.SelectionSet, v model.Requirement) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Requirement(ctx, sel, v) -} - -func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { - if v == nil { - return nil, nil - } - var vSlice []interface{} - if v != nil { - vSlice = graphql.CoerceList(v) - } - var err error - res := make([]string, len(vSlice)) - for i := range vSlice { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) - res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) - if err != nil { - return nil, err - } - } - return res, nil -} - -func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - for i := range v { - ret[i] = ec.marshalNString2string(ctx, sel, v[i]) - } - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { - if v == nil { - return nil, nil - } - res, err := graphql.UnmarshalString(v) - return &res, graphql.ErrorOnPath(ctx, err) -} - -func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { - if v == nil { - return graphql.Null - } - res := graphql.MarshalString(*v) - return res -} - -func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Schema(ctx, sel, v) -} - -func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - -func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec.___Type(ctx, sel, v) -} - -// endregion ***************************** type.gotpl ***************************** diff --git a/graphql/graph/model/academic_session.go b/graphql/graph/model/academic_session.go deleted file mode 100644 index a79af791..00000000 --- a/graphql/graph/model/academic_session.go +++ /dev/null @@ -1,7 +0,0 @@ -package model - -type AcademicSession struct { - Name string `json:"name"` - StartDate string `json:"start_date" bson:"start_date"` - EndDate string `json:"end_date" bson:"end_date"` -} diff --git a/graphql/graph/model/assistant.go b/graphql/graph/model/assistant.go deleted file mode 100644 index e4fa4878..00000000 --- a/graphql/graph/model/assistant.go +++ /dev/null @@ -1,8 +0,0 @@ -package model - -type Assistant struct { - FirstName string `json:"first_name" bson:"first_name"` - LastName string `json:"last_name" bson:"last_name"` - Role string `json:"role"` - Email string `json:"email"` -} diff --git a/graphql/graph/model/course.go b/graphql/graph/model/course.go deleted file mode 100644 index 78d19137..00000000 --- a/graphql/graph/model/course.go +++ /dev/null @@ -1,29 +0,0 @@ -package model - -import "go.mongodb.org/mongo-driver/bson/primitive" - -type Course struct { - ID string `json:"_id" bson:"_id"` - CourseNumber string `json:"course_number" bson:"course_number"` - SubjectPrefix string `json:"subject_prefix" bson:"subject_prefix"` - Title string `json:"title"` - Description string `json:"description"` - EnrollmentReqs string `json:"enrollment_reqs" bson:"enrollment_reqs"` - School string `json:"school"` - CreditHours string `json:"credit_hours" bson:"credit_hours"` - ClassLevel string `json:"class_level" bson:"class_level"` - ActivityType string `json:"activity_type" bson:"activity_type"` - Grading string `json:"grading"` - InternalCourseNumber string `json:"internal_course_number" bson:"internal_course_number"` - Prerequisites *CollectionRequirement `json:"prerequisites"` - Corequisites *CollectionRequirement `json:"corequisites"` - CoOrPreRequisites *CollectionRequirement `json:"co_or_pre_requisites" bson:"co_or_pre_requisites"` - Sections []primitive.ObjectID `json:"sections"` - LectureContactHours string `json:"lecture_contact_hours" bson:"lecture_contact_hours"` - LaboratoryContactHours string `json:"laboratory_contact_hours" bson:"laboratory_contact_hours"` - OfferingFrequency string `json:"offering_frequency" bson:"offering_frequency"` - CatalogYear string `json:"catalog_year" bson:"catalog_year"` - Attributes interface{} `json:"attributes"` -} - -func (Course) IsOutcome() {} diff --git a/graphql/graph/model/credit.go b/graphql/graph/model/credit.go deleted file mode 100644 index 02decf4b..00000000 --- a/graphql/graph/model/credit.go +++ /dev/null @@ -1,8 +0,0 @@ -package model - -type Credit struct { - Category string `json:"category"` - CreditHours int `json:"credit_hours" bson:"credit_hours"` -} - -func (Credit) IsOutcome() {} diff --git a/graphql/graph/model/exam.go b/graphql/graph/model/exam.go deleted file mode 100644 index 79746830..00000000 --- a/graphql/graph/model/exam.go +++ /dev/null @@ -1,61 +0,0 @@ -package model - -import "go.mongodb.org/mongo-driver/bson" - -type Exam interface { - IsExam() - GetID() string -} - -type Outcome interface { - IsOutcome() -} - -type ALEKSExam struct { - ID string `json:"_id" bson:"_id"` - Placement []*PossibleOutcomes `json:"placement"` -} - -func (ALEKSExam) IsExam() {} -func (this ALEKSExam) GetID() string { return this.ID } - -type APExam struct { - ID string `json:"_id" bson:"_id"` - Name string `json:"name"` - Yields []*PossibleOutcomes `json:"yields"` -} - -func (APExam) IsExam() {} -func (this APExam) GetID() string { return this.ID } - -type CLEPExam struct { - ID string `json:"_id" bson:"_id"` - Name string `json:"name"` - Yields []*PossibleOutcomes `json:"yields"` -} - -func (CLEPExam) IsExam() {} -func (this CLEPExam) GetID() string { return this.ID } - -type CSPlacementExam struct { - ID string `json:"_id" bson:"_id"` - Yields []*PossibleOutcomes `json:"yields"` -} - -func (CSPlacementExam) IsExam() {} -func (this CSPlacementExam) GetID() string { return this.ID } - -type IBExam struct { - ID string `json:"_id" bson:"_id"` - Name string `json:"name"` - Level string `json:"level"` - Yields []*PossibleOutcomes `json:"yields"` -} - -func (IBExam) IsExam() {} -func (this IBExam) GetID() string { return this.ID } - -type PossibleOutcomes struct { - Requirement bson.Raw `json:"requirement,omitempty"` - PossibleOutcomes []bson.Raw `json:"possible_outcomes" bson:"outcome"` -} diff --git a/graphql/graph/model/location.go b/graphql/graph/model/location.go deleted file mode 100644 index f6d45e18..00000000 --- a/graphql/graph/model/location.go +++ /dev/null @@ -1,7 +0,0 @@ -package model - -type Location struct { - Building string `json:"building"` - Room string `json:"room"` - MapURI string `json:"map_uri" bson:"map_uri"` -} diff --git a/graphql/graph/model/meeting.go b/graphql/graph/model/meeting.go deleted file mode 100644 index 0b16d00b..00000000 --- a/graphql/graph/model/meeting.go +++ /dev/null @@ -1,66 +0,0 @@ -package model - -import ( - "fmt" - "io" - "strconv" -) - -type Meeting struct { - StartDate string `json:"start_date" bson:"start_date"` - EndDate string `json:"end_date" bson:"end_date"` - MeetingDays []string `json:"meeting_days" bson:"meeting_days"` - StartTime string `json:"start_time" bson:"start_time"` - EndTime string `json:"end_time" bson:"end_time"` - Modality ModalityType `json:"modality"` - Location *Location `json:"location"` -} - -type ModalityType string - -const ( - ModalityTypePending ModalityType = "PENDING" - ModalityTypeTraditional ModalityType = "TRADITIONAL" - ModalityTypeHybrid ModalityType = "HYBRID" - ModalityTypeFlexible ModalityType = "FLEXIBLE" - ModalityTypeRemote ModalityType = "REMOTE" - ModalityTypeOnline ModalityType = "ONLINE" -) - -var AllModalityType = []ModalityType{ - ModalityTypePending, - ModalityTypeTraditional, - ModalityTypeHybrid, - ModalityTypeFlexible, - ModalityTypeRemote, - ModalityTypeOnline, -} - -func (e ModalityType) IsValid() bool { - switch e { - case ModalityTypePending, ModalityTypeTraditional, ModalityTypeHybrid, ModalityTypeFlexible, ModalityTypeRemote, ModalityTypeOnline: - return true - } - return false -} - -func (e ModalityType) String() string { - return string(e) -} - -func (e *ModalityType) UnmarshalGQL(v interface{}) error { - str, ok := v.(string) - if !ok { - return fmt.Errorf("enums must be strings") - } - - *e = ModalityType(str) - if !e.IsValid() { - return fmt.Errorf("%s is not a valid ModalityType", str) - } - return nil -} - -func (e ModalityType) MarshalGQL(w io.Writer) { - fmt.Fprint(w, strconv.Quote(e.String())) -} diff --git a/graphql/graph/model/professor.go b/graphql/graph/model/professor.go deleted file mode 100644 index 236125c9..00000000 --- a/graphql/graph/model/professor.go +++ /dev/null @@ -1,17 +0,0 @@ -package model - -import "go.mongodb.org/mongo-driver/bson/primitive" - -type Professor struct { - ID string `json:"_id" bson:"_id"` - FirstName string `json:"first_name" bson:"first_name"` - LastName string `json:"last_name" bson:"last_name"` - Titles []string `json:"titles"` - Email string `json:"email"` - PhoneNumber *string `json:"phone_number,omitempty" bson:"phone_number,omitempty"` - Office *Location `json:"office,omitempty" bson:",omitempty"` - ProfileURI *string `json:"profile_uri,omitempty" bson:"profile_uri,omitempty"` - ImageURI *string `json:"image_uri,omitempty" bson:"image_uri,omitempty"` - OfficeHours []*Meeting `json:"office_hours" bson:"office_hours"` - Sections []primitive.ObjectID `json:"sections"` -} diff --git a/graphql/graph/model/requirement.go b/graphql/graph/model/requirement.go deleted file mode 100644 index 5a1225b5..00000000 --- a/graphql/graph/model/requirement.go +++ /dev/null @@ -1,96 +0,0 @@ -package model - -import ( - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/bson/primitive" -) - -type Requirement interface { - IsRequirement() -} - -type CollectionRequirement struct { - Name string `json:"name" bson:"name"` - Required int `json:"required"` - Options []bson.Raw `json:"options"` -} - -func (CollectionRequirement) IsRequirement() {} - -type CourseRequirement struct { - ClassReference primitive.ObjectID `json:"class_reference" bson:"class_reference"` - MinimumGrade string `json:"minimum_grade" bson:"minimum_grade"` -} - -func (CourseRequirement) IsRequirement() {} - -type ChoiceRequirement struct { - Choices *CollectionRequirement `json:"choices"` -} - -func (ChoiceRequirement) IsRequirement() {} - -type ConsentRequirement struct { - Granter string `json:"granter"` -} - -func (ConsentRequirement) IsRequirement() {} - -type CoreRequirement struct { - CoreFlag string `json:"core_flag" bson:"core_flag"` - Hours int `json:"hours"` -} - -func (CoreRequirement) IsRequirement() {} - -type ExamRequirement struct { - ExamReference primitive.ObjectID `json:"exam_reference" bson:"exam_reference"` - MinimumScore int `json:"minimum_score" bson:"minimum_score"` -} - -func (ExamRequirement) IsRequirement() {} - -type GPARequirement struct { - Minimum float64 `json:"minimum"` - Subset string `json:"subset"` -} - -func (GPARequirement) IsRequirement() {} - -type HoursRequirement struct { - Required int `json:"required"` - Options []*CourseRequirement `json:"options"` -} - -func (HoursRequirement) IsRequirement() {} - -type LimitRequirement struct { - MaxHours int `json:"max_hours" bson:"max_hours"` -} - -func (LimitRequirement) IsRequirement() {} - -type MajorRequirement struct { - Major string `json:"major"` -} - -func (MajorRequirement) IsRequirement() {} - -type MinorRequirement struct { - Minor string `json:"minor"` -} - -func (MinorRequirement) IsRequirement() {} - -type OtherRequirement struct { - Description string `json:"description"` - Condition string `json:"condition"` -} - -func (OtherRequirement) IsRequirement() {} - -type SectionRequirement struct { - SectionReference *Section `json:"section_reference" bson:"sections_reference"` -} - -func (SectionRequirement) IsRequirement() {} diff --git a/graphql/graph/model/section.go b/graphql/graph/model/section.go deleted file mode 100644 index a3a82e06..00000000 --- a/graphql/graph/model/section.go +++ /dev/null @@ -1,24 +0,0 @@ -package model - -import "go.mongodb.org/mongo-driver/bson/primitive" - -type Section struct { - ID string `json:"_id" bson:"_id"` - SectionNumber string `json:"section_number" bson:"section_number"` - CourseReference primitive.ObjectID `json:"course_reference" bson:"course_reference"` - SectionCorequisites *CollectionRequirement `json:"section_corequisites" bson:"sections_corequisites"` - AcademicSession *AcademicSession `json:"academic_session" bson:"academic_session"` - Professors []primitive.ObjectID `json:"professors"` - TeachingAssistants []*Assistant `json:"teaching_assistants" bson:"teaching_assistants"` - InternalClassNumber string `json:"internal_class_number" bson:"internal_class_number"` - InstructionMode string `json:"instruction_mode" bson:"instruction_mode"` - Meetings []*Meeting `json:"meetings"` - CoreFlags []string `json:"core_flags" bson:"core_flags"` - SyllabusURI string `json:"syllabus_uri" bson:"syllabus_uri"` - GradeDistribution []int `json:"grade_distribution" bson:"grade_distribution"` - Attributes *Attributes `json:"attributes"` -} - -type Attributes struct { - RawAttributes []string `json:"raw_attributes" bson:"raw_attributes"` -} diff --git a/graphql/graph/professor.resolvers.go b/graphql/graph/professor.resolvers.go deleted file mode 100644 index aea85a95..00000000 --- a/graphql/graph/professor.resolvers.go +++ /dev/null @@ -1,30 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.27 - -import ( - "context" - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" -) - -// Sections is the resolver for the sections field. -func (r *professorResolver) Sections(ctx context.Context, obj *model.Professor) ([]*model.Section, error) { - var out []*model.Section - section_ids := obj.Sections - for _, id := range section_ids { - section, err := r.Query().SectionByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - out = append(out, section) - } - return out, nil -} - -// Professor returns ProfessorResolver implementation. -func (r *Resolver) Professor() ProfessorResolver { return &professorResolver{r} } - -type professorResolver struct{ *Resolver } diff --git a/graphql/graph/requirement.resolvers.go b/graphql/graph/requirement.resolvers.go deleted file mode 100644 index 94351d83..00000000 --- a/graphql/graph/requirement.resolvers.go +++ /dev/null @@ -1,122 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.27 - -import ( - "context" - "fmt" - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" - "go.mongodb.org/mongo-driver/bson" -) - -// Options is the resolver for the options field. -func (r *collectionRequirementResolver) Options(ctx context.Context, obj *model.CollectionRequirement) ([]model.Requirement, error) { - var out []model.Requirement - for _, v := range obj.Options { - - bytes, err := bson.Marshal(v) - if err != nil { - return nil, err - } - - optionType := v.Lookup("type").StringValue() - - switch optionType { - case "course": - var t model.CourseRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "section": - var t model.SectionRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "exam": - var t model.ExamRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "major": - var t model.MajorRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "minor": - var t model.MinorRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "gpa": - var t model.GPARequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "consent": - var t model.ConsentRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "collection": - var t model.CollectionRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "hours": - var t model.HoursRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "other": - var t model.OtherRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "choice": - var t model.ChoiceRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "limit": - var t model.LimitRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - case "core": - var t model.CoreRequirement - bson.Unmarshal(bytes, &t) - out = append(out, t) - default: - return nil, fmt.Errorf("unkown option type: %v", err) - } - } - return out, nil -} - -// ClassReference is the resolver for the class_reference field. -func (r *courseRequirementResolver) ClassReference(ctx context.Context, obj *model.CourseRequirement) (*model.Course, error) { - id := obj.ClassReference - course, err := r.Query().CourseByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - return course, nil -} - -// ExamReference is the resolver for the exam_reference field. -func (r *examRequirementResolver) ExamReference(ctx context.Context, obj *model.ExamRequirement) (model.Exam, error) { - id := obj.ExamReference - exam, err := r.Query().ExamByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - return exam, nil -} - -// CollectionRequirement returns CollectionRequirementResolver implementation. -func (r *Resolver) CollectionRequirement() CollectionRequirementResolver { - return &collectionRequirementResolver{r} -} - -// CourseRequirement returns CourseRequirementResolver implementation. -func (r *Resolver) CourseRequirement() CourseRequirementResolver { - return &courseRequirementResolver{r} -} - -// ExamRequirement returns ExamRequirementResolver implementation. -func (r *Resolver) ExamRequirement() ExamRequirementResolver { return &examRequirementResolver{r} } - -type collectionRequirementResolver struct{ *Resolver } -type courseRequirementResolver struct{ *Resolver } -type examRequirementResolver struct{ *Resolver } diff --git a/graphql/graph/resolver.go b/graphql/graph/resolver.go deleted file mode 100644 index e28c7038..00000000 --- a/graphql/graph/resolver.go +++ /dev/null @@ -1,13 +0,0 @@ -package graph - -//go:generate go run github.com/99designs/gqlgen generate - -import "go.mongodb.org/mongo-driver/mongo" - -// This file will not be regenerated automatically. -// -// It serves as dependency injection for your app, add any dependencies you require here. - -type Resolver struct { - DB *mongo.Database -} diff --git a/graphql/graph/schema.resolvers.go b/graphql/graph/schema.resolvers.go deleted file mode 100644 index e21a364b..00000000 --- a/graphql/graph/schema.resolvers.go +++ /dev/null @@ -1,331 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.27 - -import ( - "context" - "fmt" - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/bson/primitive" -) - -// CourseByID is the resolver for the courseByID field. -func (r *queryResolver) CourseByID(ctx context.Context, id string) (*model.Course, error) { - coll := r.DB.Collection("courses") - - oid, err := primitive.ObjectIDFromHex(id) - if err != nil { - fmt.Println(err) - return nil, err - } - - filter := bson.D{{"_id", oid}} - var result *model.Course - err = coll.FindOne(ctx, filter).Decode(&result) - if err != nil { - fmt.Println(err) - return nil, err - } - - return result, nil -} - -// Course is the resolver for the course field. -func (r *queryResolver) Course(ctx context.Context, courseNumber *string, subjectPrefix *string, title *string, description *string, school *string, creditHours *string, classLevel *string, activityType *string, grading *string, internalCourseNumber *string, lectureContactHours *string, offeringFrequency *string) ([]*model.Course, error) { - coll := r.DB.Collection("courses") - - var results []*model.Course - filter := bson.D{} - - if courseNumber != nil { - filter = append(filter, bson.E{"course_number", courseNumber}) - } - if subjectPrefix != nil { - filter = append(filter, bson.E{"subject_prefix", subjectPrefix}) - } - if title != nil { - filter = append(filter, bson.E{"title", title}) - } - if description != nil { - filter = append(filter, bson.E{"description", description}) - } - if school != nil { - filter = append(filter, bson.E{"school", school}) - } - if creditHours != nil { - filter = append(filter, bson.E{"credit_hours", creditHours}) - } - if classLevel != nil { - filter = append(filter, bson.E{"class_level", classLevel}) - } - if activityType != nil { - filter = append(filter, bson.E{"activity_type", activityType}) - } - if grading != nil { - filter = append(filter, bson.E{"grading", grading}) - } - if internalCourseNumber != nil { - filter = append(filter, bson.E{"internal_course_number", internalCourseNumber}) - } - if lectureContactHours != nil { - filter = append(filter, bson.E{"lecture_contact_hours", lectureContactHours}) - } - if offeringFrequency != nil { - filter = append(filter, bson.E{"offering_frequency", offeringFrequency}) - } - - cursor, err := coll.Find(ctx, filter) - if err != nil { - fmt.Println(err) - return nil, err - } - cursor.All(ctx, &results) - return results, nil -} - -// SectionByID is the resolver for the sectionByID field. -func (r *queryResolver) SectionByID(ctx context.Context, id string) (*model.Section, error) { - coll := r.DB.Collection("sections") - - oid, err := primitive.ObjectIDFromHex(id) - if err != nil { - fmt.Println(err) - return nil, err - } - - filter := bson.D{{"_id", oid}} - var result *model.Section - err = coll.FindOne(ctx, filter).Decode(&result) - if err != nil { - fmt.Println(err) - return nil, err - } - - return result, nil -} - -// Section is the resolver for the section field. -func (r *queryResolver) Section(ctx context.Context, sectionNumber *string, courseReference *string, internalClassNumber *string, instructionMode *string, syllabusURI *string) ([]*model.Section, error) { - coll := r.DB.Collection("sections") - - var results []*model.Section - filter := bson.D{} - - if sectionNumber != nil { - filter = append(filter, bson.E{"section_number", sectionNumber}) - } - if courseReference != nil { - filter = append(filter, bson.E{"course_reference", courseReference}) - } - if internalClassNumber != nil { - filter = append(filter, bson.E{"internal_class_number", internalClassNumber}) - } - if instructionMode != nil { - filter = append(filter, bson.E{"instruction_mode", instructionMode}) - } - if syllabusURI != nil { - filter = append(filter, bson.E{"syllabus_uri", syllabusURI}) - } - - cursor, err := coll.Find(ctx, filter) - if err != nil { - return nil, err - } - cursor.All(ctx, &results) - return results, nil -} - -// ProfessorByID is the resolver for the professorByID field. -func (r *queryResolver) ProfessorByID(ctx context.Context, id string) (*model.Professor, error) { - coll := r.DB.Collection("professors") - - oid, err := primitive.ObjectIDFromHex(id) - if err != nil { - fmt.Println(err) - return nil, err - } - - filter := bson.D{{"_id", oid}} - var result *model.Professor - err = coll.FindOne(ctx, filter).Decode(&result) - if err != nil { - fmt.Println(err) - return nil, err - } - - return result, nil -} - -// Professor is the resolver for the professor field. -func (r *queryResolver) Professor(ctx context.Context, firstName *string, lastName *string, titles []string, email *string, phoneNumber *string, profileURI *string, imageURI *string) ([]*model.Professor, error) { - coll := r.DB.Collection("professors") - - var results []*model.Professor - filter := bson.D{} - - if firstName != nil { - filter = append(filter, bson.E{"first_name", firstName}) - } - if lastName != nil { - filter = append(filter, bson.E{"last_name", lastName}) - } - if titles != nil { - filter = append(filter, bson.E{"titles", titles}) - } - if email != nil { - filter = append(filter, bson.E{"email", email}) - } - if phoneNumber != nil { - filter = append(filter, bson.E{"phone_number", phoneNumber}) - } - if profileURI != nil { - filter = append(filter, bson.E{"profile_uri", profileURI}) - } - if imageURI != nil { - filter = append(filter, bson.E{"image_uri", imageURI}) - } - - cursor, err := coll.Find(ctx, filter) - if err != nil { - return nil, err - } - cursor.All(ctx, &results) - return results, nil -} - -// ExamByID is the resolver for the examByID field. -func (r *queryResolver) ExamByID(ctx context.Context, id string) (model.Exam, error) { - coll := r.DB.Collection("exams") - - oid, err := primitive.ObjectIDFromHex(id) - if err != nil { - return nil, err - } - - filter := bson.D{{"_id", oid}} - var raw bson.Raw - err = coll.FindOne(ctx, filter).Decode(&raw) - if err != nil { - return nil, err - } - - switch raw.Lookup("type").StringValue() { - case "AP": - var result model.APExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - return result, nil - case "CLEP": - var result model.CLEPExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - return result, nil - case "IB": - var result model.IBExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - return result, nil - case "ALEKS": - var result model.ALEKSExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - return result, nil - case "CSPlacement": - var result model.CSPlacementExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - return result, nil - default: - return nil, fmt.Errorf("unable to unmarshal exam: %s", err) - } -} - -// Exam is the resolver for the exam field. -func (r *queryResolver) Exam(ctx context.Context, typeArg *string, name *string, level *string) ([]model.Exam, error) { - coll := r.DB.Collection("exams") - - var results []model.Exam - filter := bson.D{} - - if typeArg != nil { - filter = append(filter, bson.E{"type", typeArg}) - } - if name != nil { - filter = append(filter, bson.E{"name", name}) - } - if level != nil { - filter = append(filter, bson.E{"level", level}) - } - - cursor, err := coll.Find(ctx, filter) - if err != nil { - fmt.Println(err) - return nil, err - } - - var raws []bson.Raw - - cursor.All(ctx, &raws) - - for _, raw := range raws { - switch raw.Lookup("type").StringValue() { - case "AP": - var result model.APExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - results = append(results, result) - case "CLEP": - var result model.CLEPExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - results = append(results, result) - case "IB": - var result model.IBExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - results = append(results, result) - case "ALEKS": - var result model.ALEKSExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - results = append(results, result) - case "CSPlacement": - var result model.CSPlacementExam - err = bson.Unmarshal(raw, &result) - if err != nil { - return nil, err - } - results = append(results, result) - default: - return nil, fmt.Errorf("unable to unmarshal exam: %s", err) - } - } - return results, nil -} - -// Query returns QueryResolver implementation. -func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } - -type queryResolver struct{ *Resolver } diff --git a/graphql/graph/schema/academic_session.graphqls b/graphql/graph/schema/academic_session.graphqls deleted file mode 100644 index 253cf760..00000000 --- a/graphql/graph/schema/academic_session.graphqls +++ /dev/null @@ -1,5 +0,0 @@ -type AcademicSession { - name: String! - start_date: String! # @TODO: Resolve to DateTime type? - end_date: String! # @TODO: Resolve to DateTime type? -} \ No newline at end of file diff --git a/graphql/graph/schema/assistant.graphqls b/graphql/graph/schema/assistant.graphqls deleted file mode 100644 index 61502a2a..00000000 --- a/graphql/graph/schema/assistant.graphqls +++ /dev/null @@ -1,6 +0,0 @@ -type Assistant { - first_name: String! - last_name: String! - role: String! - email: String! -} \ No newline at end of file diff --git a/graphql/graph/schema/course.graphqls b/graphql/graph/schema/course.graphqls deleted file mode 100644 index 05a4265f..00000000 --- a/graphql/graph/schema/course.graphqls +++ /dev/null @@ -1,23 +0,0 @@ -type Course { - _id: ID! - course_number: String! - subject_prefix: String! - title: String! - description: String! - enrollment_reqs: String! - school: String! - credit_hours: String! - class_level: String! - activity_type: String! - grading: String! - internal_course_number: String! - prerequisites: CollectionRequirement - corequisites: CollectionRequirement - co_or_pre_requisites: CollectionRequirement - sections: [Section!]! - lecture_contact_hours: String! - laboratory_contact_hours: String! - offering_frequency: String! - catalog_year: String! - # attributes: Attributes # @TODO: Doesn't exist in DB, remove and update docs, or fix DB -} \ No newline at end of file diff --git a/graphql/graph/schema/credit.graphqls b/graphql/graph/schema/credit.graphqls deleted file mode 100644 index e3cbc219..00000000 --- a/graphql/graph/schema/credit.graphqls +++ /dev/null @@ -1,4 +0,0 @@ -type Credit { - category: String! # @TODO: update to enum - credit_hours: Int! -} \ No newline at end of file diff --git a/graphql/graph/schema/exam.graphqls b/graphql/graph/schema/exam.graphqls deleted file mode 100644 index bf04aecb..00000000 --- a/graphql/graph/schema/exam.graphqls +++ /dev/null @@ -1,40 +0,0 @@ -union Outcome = Course | Credit - -# @TODO: Update Exam docs -type PossibleOutcomes { - requirement: Requirement - possible_outcomes: [[Outcome!]!]! -} - -interface Exam { - _id: ID! -} - -type APExam implements Exam { - _id: ID! - name: String! - yields: [PossibleOutcomes!]! -} - -type ALEKSExam implements Exam { - _id: ID! - placement: [PossibleOutcomes!]! -} - -type CLEPExam implements Exam { - _id: ID! - name: String! - yields: [PossibleOutcomes!]! -} - -type IBExam implements Exam { - _id: ID! - name: String! - level: String! - yields: [PossibleOutcomes!]! -} - -type CSPlacementExam implements Exam { - _id: ID! - yields: [PossibleOutcomes!]! -} \ No newline at end of file diff --git a/graphql/graph/schema/location.graphqls b/graphql/graph/schema/location.graphqls deleted file mode 100644 index cbcdbbb3..00000000 --- a/graphql/graph/schema/location.graphqls +++ /dev/null @@ -1,5 +0,0 @@ -type Location { - building: String! - room: String! - map_uri: String! -} \ No newline at end of file diff --git a/graphql/graph/schema/meeting.graphqls b/graphql/graph/schema/meeting.graphqls deleted file mode 100644 index df5cbfd6..00000000 --- a/graphql/graph/schema/meeting.graphqls +++ /dev/null @@ -1,19 +0,0 @@ -# @TODO: enum convention is for values to be all caps. Update in DB, or handle in resolver -enum ModalityType { - PENDING - TRADITIONAL - HYBRID - FLEXIBLE - REMOTE - ONLINE -} - -type Meeting { - start_date: String! - end_date: String! - meeting_days: [String!]! - start_time: String! - end_time: String! - modality: ModalityType! - location: Location! -} \ No newline at end of file diff --git a/graphql/graph/schema/professor.graphqls b/graphql/graph/schema/professor.graphqls deleted file mode 100644 index 7a7359ff..00000000 --- a/graphql/graph/schema/professor.graphqls +++ /dev/null @@ -1,15 +0,0 @@ -# @TODO: Fix DB and make profiles data required (!) - -type Professor { - _id: ID! - first_name: String! - last_name: String! - titles: [String!]! - email: String! - phone_number: String - office: Location - profile_uri: String - image_uri: String - office_hours: [Meeting!]! - sections: [Section!]! -} \ No newline at end of file diff --git a/graphql/graph/schema/requirement.graphqls b/graphql/graph/schema/requirement.graphqls deleted file mode 100644 index e91356b6..00000000 --- a/graphql/graph/schema/requirement.graphqls +++ /dev/null @@ -1,164 +0,0 @@ -# GraphQL removes the need for the type field, and doesn't support static values in schema, -# so there are no shared fields for requirements, so we are using a Union type -# and not using the ENUM example below. - -union Requirement = CourseRequirement | SectionRequirement | ExamRequirement | MajorRequirement | MinorRequirement | GPARequirement | ConsentRequirement | CollectionRequirement | HoursRequirement | OtherRequirement | ChoiceRequirement | LimitRequirement | CoreRequirement - -type CourseRequirement { - class_reference: Course! # @TODO: rename to course? - minimum_grade: String! -} - -type SectionRequirement { - section_reference: Section! # @TODO: rename to section? -} - -type ExamRequirement { - exam_reference: Exam! # @TODO: rename to exam? - minimum_score: Int! -} - -type MajorRequirement { - major: String! -} - -type MinorRequirement { - minor: String! -} - -type GPARequirement { - minimum: Float! - subset: String! -} - -type ConsentRequirement { - granter: String! -} - -type CollectionRequirement { - name: String! - required: Int! - options: [Requirement!]! -} - -type HoursRequirement { - required: Int! - options: [CourseRequirement!]! -} - -type OtherRequirement { - description: String! - condition: String! -} - -# @TODO: Do we even need the ChoiceRequirement type? -# Isn't a CollectionRequirement with required == 1 functionally equivalent? -type ChoiceRequirement { - choices: CollectionRequirement! -} - -type LimitRequirement { - max_hours: Int! -} - -type CoreRequirement { - core_flag: String! - hours: Int! -} - - -# SHOULD NOT USE! Read comment at top of file - -# With ENUM - -# enum convention is all caps, breaks our schema - -# enum RequirementType { -# COURSE -# SECTION -# EXAM -# MAJOR -# MINOR -# GPA -# CONSENT -# COLLECTION -# HOURS -# OTHER -# } - -#interface Requirement { -# type: RequirementType! -#} - -# type CourseRequirement implements Requirement { -# type: RequirementType! -# class_reference: ID! -# minimum_grade: String! -# } - -# type SectionRequirement implements Requirement { -# type: RequirementType! -# section_reference: ID! -# } - -# type ExamRequirement implements Requirement { -# type: RequirementType! -# exam_reference: ID! -# minimum_score: number! -# } - -# type MajorRequirement implements Requirement { -# type: RequirementType! -# major: String! -# } - -# type MinorRequirement implements Requirement { -# type: RequirementType! -# minor: String! -# } - -# type GPARequirement implements Requirement { -# type: RequirementType! -# minimum: number! -# subset: String! -# } - -# type ConsentRequirement implements Requirement { -# type: RequirementType! -# granter: String! -# } - -# type OtherRequirement implements Requirement { -# type: RequirementType! -# description: String! -# condition: String! -# } - -# type CollectionRequirement implements Requirement { -# type: RequirementType! -# name: String! -# required: number! -# options: [Requirement!]! -# } - -# type HoursRequirement implements Requirement { -# type: RequirementType! -# required: number! -# options: [CourseRequirement!]! -# } - -# type ChoiceRequirement implements Requirement { -# type: RequirementType! -# choices: CollectionRequirement! -# } - -# type LimitRequirement implements Requirement { -# type: RequirementType! -# max_hours: number! -# } - -# type CoreRequirement implements Requirement { -# type: RequirementType! -# core_flag: String! -# hours: number! -# } diff --git a/graphql/graph/schema/schema.graphqls b/graphql/graph/schema/schema.graphqls deleted file mode 100644 index 99ee8af0..00000000 --- a/graphql/graph/schema/schema.graphqls +++ /dev/null @@ -1,45 +0,0 @@ -# GraphQL schema example -# -# https://gqlgen.com/getting-started/ - -# Use interfaces (rarely may use union types) in place of inheretance - -type Query { - courseByID(id: ID!): Course! - course(course_number: String, - subject_prefix: String, - title: String, - description: String, - school: String, - credit_hours: String, - class_level: String, - activity_type: String, - grading: String, - internal_course_number: String, - lecture_contact_hours: String, - offering_frequency: String): [Course!]! - - - sectionByID(id: ID!): Section! - section(section_number: String, - course_reference: ID, - internal_class_number: String, - instruction_mode: String, - syllabus_uri: String): [Section!]! - # TODO: Academic Session, Teaching Assistants, Meetings, Professors - - professorByID(id: ID!): Professor! - professor(first_name: String, - last_name: String, - titles: [String!], - email: String, - phone_number: String, - profile_uri: String, - image_uri: String): [Professor!]! - # TODO: Office, Office Hours, Sections - - examByID(id: ID!): Exam! - exam(type: String, - name: String, - level: String): [Exam!]! -} \ No newline at end of file diff --git a/graphql/graph/schema/section.graphqls b/graphql/graph/schema/section.graphqls deleted file mode 100644 index bfce0749..00000000 --- a/graphql/graph/schema/section.graphqls +++ /dev/null @@ -1,20 +0,0 @@ -type Section { - _id: ID! - section_number: String! - course_reference: Course! - section_corequisites: CollectionRequirement! - academic_session: AcademicSession! - professors: [Professor!]! - teaching_assistants: [Assistant!]! - internal_class_number: String! - instruction_mode: String! - meetings: [Meeting!]! - core_flags: [String!]! - syllabus_uri: String! - grade_distribution: [Int!]! - attributes: Attributes! -} - -type Attributes { - raw_attributes: [String!]! -} \ No newline at end of file diff --git a/graphql/graph/section.resolvers.go b/graphql/graph/section.resolvers.go deleted file mode 100644 index 51586610..00000000 --- a/graphql/graph/section.resolvers.go +++ /dev/null @@ -1,40 +0,0 @@ -package graph - -// This file will be automatically regenerated based on the schema, any resolver implementations -// will be copied through when generating and any unknown code will be moved to the end. -// Code generated by github.com/99designs/gqlgen version v0.17.27 - -import ( - "context" - - "github.com/LocatingWizard/nebula_api_graphql/graph/model" -) - -// CourseReference is the resolver for the course_reference field. -func (r *sectionResolver) CourseReference(ctx context.Context, obj *model.Section) (*model.Course, error) { - id := obj.CourseReference - course, err := r.Query().CourseByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - return course, nil -} - -// Professors is the resolver for the professors field. -func (r *sectionResolver) Professors(ctx context.Context, obj *model.Section) ([]*model.Professor, error) { - var out []*model.Professor - prof_ids := obj.Professors - for _, id := range prof_ids { - prof, err := r.Query().ProfessorByID(ctx, id.Hex()) - if err != nil { - return nil, err - } - out = append(out, prof) - } - return out, nil -} - -// Section returns SectionResolver implementation. -func (r *Resolver) Section() SectionResolver { return §ionResolver{r} } - -type sectionResolver struct{ *Resolver } diff --git a/graphql/server.go b/graphql/server.go deleted file mode 100644 index fb9b04f9..00000000 --- a/graphql/server.go +++ /dev/null @@ -1,62 +0,0 @@ -package main - -import ( - "context" - "fmt" - "log" - "net/http" - "os" - - "github.com/99designs/gqlgen/graphql/handler" - "github.com/99designs/gqlgen/graphql/playground" - "github.com/LocatingWizard/nebula_api_graphql/graph" - "github.com/joho/godotenv" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "go.mongodb.org/mongo-driver/mongo/readpref" -) - -const defaultPort = "8080" - -func main() { - err := godotenv.Load() - if err != nil { - log.Fatal("Error loading .env file") - } - - port := os.Getenv("PORT") - if port == "" { - port = defaultPort - } - - uri := os.Getenv("MONGODB_URI") - - serverAPI := options.ServerAPI(options.ServerAPIVersion1) - opts := options.Client().ApplyURI(uri).SetServerAPIOptions(serverAPI) - // Create a new client and connect to the server - client, err := mongo.Connect(context.TODO(), opts) - if err != nil { - panic(err) - } - defer func() { - if err = client.Disconnect(context.TODO()); err != nil { - panic(err) - } - }() - - // Send a ping to confirm a successful connection - if err := client.Ping(context.TODO(), readpref.Primary()); err != nil { - panic(err) - } - fmt.Println("Pinged the primary node of the cluster. You successfully connected to MongoDB!") - - db := client.Database("combinedDB") - // pass the database object into the Resolver struct object (dependency injection) - srv := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{DB: db}})) - - http.Handle("/", playground.Handler("GraphQL playground", "/query")) - http.Handle("/query", srv) - - log.Printf("connect to http://localhost:%s/ for GraphQL playground", port) - log.Fatal(http.ListenAndServe(":"+port, nil)) -} diff --git a/graphql/tools.go b/graphql/tools.go deleted file mode 100644 index fcdeac47..00000000 --- a/graphql/tools.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build tools -// +build tools - -package tools - -import ( - _ "github.com/99designs/gqlgen" -)