diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..c0f580c Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f97993d --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ + +remo-backend/.idea +remo-backend/.idea/vcs.xml +remo-backend/.idea/remo-backend.iml +remo-backend/.idea/modules.xml diff --git a/.gitignore 2 b/.gitignore 2 new file mode 100644 index 0000000..f97993d --- /dev/null +++ b/.gitignore 2 @@ -0,0 +1,5 @@ + +remo-backend/.idea +remo-backend/.idea/vcs.xml +remo-backend/.idea/remo-backend.iml +remo-backend/.idea/modules.xml diff --git a/docker-compose.yaml b/docker-compose.yaml index 2bf2e46..73ae094 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,7 +7,7 @@ services: - db:/var/lib/mysql ports: # mapping host port 3200 to container port 3306 - - 3213:3306 + - 3333:3306 restart: unless-stopped environment: diff --git a/remo-backend/Taskfile.yaml b/remo-backend/Taskfile.yaml index 2e08862..514072d 100644 --- a/remo-backend/Taskfile.yaml +++ b/remo-backend/Taskfile.yaml @@ -11,4 +11,4 @@ tasks: test-all: - go test ./... connect: - - mysql -u remo --password=pwd -P 3213 -h localhost --protocol=tcp + - mysql -u remo --password=pwd -P 3333 -h localhost --protocol=tcp diff --git a/remo-backend/go.mod b/remo-backend/go.mod index eb3ac7b..66474e1 100644 --- a/remo-backend/go.mod +++ b/remo-backend/go.mod @@ -3,17 +3,20 @@ module remo/backend go 1.19 require ( - github.com/99designs/gqlgen v0.17.22 + github.com/99designs/gqlgen v0.17.24 github.com/gin-gonic/gin v1.8.2 github.com/huandu/go-assert v1.1.5 + github.com/jinzhu/gorm v1.9.16 github.com/vektah/gqlparser/v2 v2.5.1 ) require ( github.com/agnivade/levenshtein v1.1.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/urfave/cli/v2 v2.8.1 // indirect @@ -32,6 +35,7 @@ require ( github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/go-sql-driver/mysql v1.7.0 github.com/goccy/go-json v0.10.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.3 github.com/json-iterator/go v1.1.12 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/mattn/go-isatty v0.0.17 // indirect @@ -39,10 +43,10 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/ugorji/go/codec v1.2.8 // indirect - golang.org/x/crypto v0.5.0 - golang.org/x/net v0.5.0 // indirect - golang.org/x/sys v0.4.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/crypto v0.5.0 // indirect + golang.org/x/net v0.6.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/remo-backend/go.sum b/remo-backend/go.sum index 57b464c..10cca4e 100644 --- a/remo-backend/go.sum +++ b/remo-backend/go.sum @@ -1,11 +1,13 @@ -github.com/99designs/gqlgen v0.17.22 h1:TOcrF8t0T3I0za9JD3CB6ehq7dDEMjR9Onikf8Lc/04= -github.com/99designs/gqlgen v0.17.22/go.mod h1:BMhYIhe4bp7OlCo5I2PnowSK/Wimpv/YlxfNkqZGwLo= +github.com/99designs/gqlgen v0.17.24 h1:pcd/HFIoSdRvyADYQG2dHvQN2KZqX/nXzlVm6TMMq7E= +github.com/99designs/gqlgen v0.17.24/go.mod h1:BMhYIhe4bp7OlCo5I2PnowSK/Wimpv/YlxfNkqZGwLo= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= 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/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= 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.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= @@ -14,10 +16,14 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 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/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM= +github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 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/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.8.2 h1:UzKToD9/PoFj/V4rvlKqTRKnQYyz8Sc1MJlv4JHPtvY= @@ -31,13 +37,19 @@ github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/j github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU= +github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -45,6 +57,12 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= +github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o= +github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= +github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= @@ -58,12 +76,16 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4= +github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc= github.com/matryer/moq v0.2.7/go.mod h1:kITsx543GOENm48TUAQyJ9+SAvFSr7iGQXPoth/VUBk= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA= +github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus= 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/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -105,6 +127,8 @@ github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsr github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= @@ -112,17 +136,23 @@ golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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= @@ -131,8 +161,8 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -140,8 +170,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= @@ -150,7 +180,6 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/remo-backend/graph/api_test.go b/remo-backend/graph/api_test.go new file mode 100644 index 0000000..6d46cb7 --- /dev/null +++ b/remo-backend/graph/api_test.go @@ -0,0 +1,117 @@ +package graph + +// query { +// getBookByISBN(isbn: 9781525303890) { +// id +// isbn_13 +// title +// author +// } +// } +// ngrok http 8080 +// postman URL: https://ea01-155-33-132-61.ngrok.io +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "testing" +) + +// the url generated by ngrok. Needs to be refreshed every hour +var queryEndpointURL = "https://ea01-155-33-132-61.ngrok.io" + +// TESTS NEEDED +// accurate get requests +// accurate post requests + +// test for getting books by ISBN request +// technically a POST request because we're sending a JSON, but performs the function of a GET request +func TestAPIGetBookByISBN(t *testing.T) { + + // below request and response JSONs were collected from postman + query := `query { + getBookByISBN(isbn: 9781525303890) { + isbn_13 + id + author + num_pages + } + }` + + request := struct { + Query string `json:"query"` + }{Query: query} + + requestBody, err := json.Marshal(request) + if err != nil { + t.Errorf("Unable to marshal request into JSON: %q", err) + } + + // "application/json" + response, err := http.Post(queryEndpointURL+"/v1/query", "application/json", bytes.NewBuffer(requestBody)) + if err != nil { + t.Errorf("Unable to complete POST request properly: %q", err) + } + + defer response.Body.Close() + + var result map[string]interface{} + + err = json.NewDecoder(response.Body).Decode(&result) + + if err != nil { + t.Errorf("Unable to decode request from JSON: %q", err) + } + + fmt.Println(result) +} + +func TestAPICreateBook(t *testing.T) { + + // below request and response JSONs were collected from postman + // mutation query request + + //************************************************************ + // INCOMPLETE. MUST FINISH QUERY - MAKE SURE BOOK INPUT IS PROPERLY FORMATTED + // ASK CHATGPT OR BOOT UP PLAYGROUND + + query := `mutation { + createBook (input: { + id: 1 + default_user_id: 1 + story_id: 1 + }){ + id + default_user_id + story_id + } + } + }` + + request := struct { + Query string `json:"query"` + }{Query: query} + + requestBody, err := json.Marshal(request) + if err != nil { + t.Errorf("Unable to marshal request into JSON: %q", err) + } + + response, err := http.Post(queryEndpointURL, "application/json", bytes.NewBuffer(requestBody)) + if err != nil { + t.Errorf("Unable to complete POST request properly: %q", err) + } + + defer response.Body.Close() + + var result map[string]interface{} + + err = json.NewDecoder(response.Body).Decode(&result) + + if err != nil { + t.Errorf("Unable to decode request from JSON: %q", err) + } + + fmt.Println(result) +} diff --git a/remo-backend/graph/db_connection_test.go b/remo-backend/graph/db_connection_test.go new file mode 100644 index 0000000..40f534f --- /dev/null +++ b/remo-backend/graph/db_connection_test.go @@ -0,0 +1,81 @@ +package graph + +import ( + "remo/backend/graph/model" + "testing" + + _ "github.com/go-sql-driver/mysql" +) + +// Test that we are able to successfully connect to the database and query for a book +func TestDbInitConnection(t *testing.T) { + db, err := DbInitConnection() + + // query for book with id 1 + rows, err := db.Query("SELECT * FROM books WHERE id = 1") + if err != nil { + t.Errorf("Failed to query database: %q\n", err) + } + // not sure if this is necessary + defer rows.Close() + + testBook := model.Book{} + + for rows.Next() { + //var col1, col2 string + var a interface{} + err := rows.Scan(&testBook.ID, &a, &testBook.Author, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a, &a) + if err != nil { + t.Errorf("Rip: %q\n", err) + } + + } + + if testBook.ID != "1" { + t.Errorf("Test book ID is not 1. Actual ID: %q\n", testBook.ID) + } + + if testBook.Author != "Carrie S. Allen" { + t.Errorf("Test book author is not correct. Actual Author: %q\n", testBook.Author) + } + + if testBook.ID == "" { + t.Fatalf("Test book ID is null.") + } + + //// Not sure if this test is necessary? Concerning that it fails tho + //err2 := db.Ping() + //if err2 != nil { + // t.Errorf("Ping message was not successfully sent to Remo db.") + //} +} + +//func TestCreateBook(t *testing.T) { +// +// // Set up the mutation resolver with the mock database connection +// resolver := &mutationResolver{} +// +// // Set up the input for the CreateBook method +// input := model.BookInput{ +// ID: "123", +// DefaultUserID: "456", +// } +// fmt.Printf("totally not explicit message \n") +// +// // Call the CreateBook method with the input +// book, err := resolver.CreateBook(context.Background(), input) +// if err != nil { +// t.Fatalf("CreateBook returned an error: %v", err) +// } +// +// // Check the output +// if book == nil { +// t.Fatal("CreateBook did not return a book") +// } +// if book.ID != input.ID { +// t.Errorf("CreateBook returned a book with ID %s, expected %s", book.ID, input.ID) +// } +// if book.Default_user_id != input.DefaultUserID { +// t.Errorf("CreateBook returned a book with default_user_id %s, expected %s", book.Default_user_id, input.DefaultUserID) +// } +//} diff --git a/remo-backend/graph/db_init_connection.go b/remo-backend/graph/db_init_connection.go new file mode 100644 index 0000000..e6de4b6 --- /dev/null +++ b/remo-backend/graph/db_init_connection.go @@ -0,0 +1,22 @@ +package graph + +import ( + "database/sql" +) + +// DbInitConnection +// Initialize a connection to the database. +func DbInitConnection() (*sql.DB, error) { + db, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb?parseTime=true") + if err != nil { + print("Failed to connect to database:", err) + } + + // After establishing conneciton, ping the database + err = db.Ping() + if err != nil { + print("Failed to ping database:", err) + } + + return db, err +} diff --git a/remo-backend/graph/endpoint_queries.go b/remo-backend/graph/endpoint_queries.go new file mode 100644 index 0000000..f8786dd --- /dev/null +++ b/remo-backend/graph/endpoint_queries.go @@ -0,0 +1,29 @@ +package graph + +import "remo/backend/graph/model" + +// Trying to write for this endpoint in book-services.tsx: +// export const returnBook = async (barcode: String) => { +// const bcode = barcode["barcode"]; + +// const response = await axios.put( +// `${API_URL}/v1/return/${bcode}` +// ); +// console.log("barcode; ", barcode); +// console.log("the response is ------"); +// console.log(response); +// return response.data; +// }; + +// Function attempting to model the above functionality. +func returnBook(barcode string) (model.Book, error) { + + // parse barcode for ISBN_13 + + // query remoDB + + var mtBook *model.Book + return *mtBook, err + + // assign values from resolver query to +} diff --git a/remo-backend/graph/generated.go b/remo-backend/graph/generated.go index e6870be..8d5e831 100644 --- a/remo-backend/graph/generated.go +++ b/remo-backend/graph/generated.go @@ -12,6 +12,7 @@ import ( "strconv" "sync" "sync/atomic" + "time" "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" @@ -37,9 +38,13 @@ type Config struct { } type ResolverRoot interface { - Book() BookResolver + Classroom() ClassroomResolver Mutation() MutationResolver Query() QueryResolver + ReadingRateResult() ReadingRateResultResolver + Student() StudentResolver + Teacher() TeacherResolver + UserBook() UserBookResolver } type DirectiveRoot struct { @@ -47,38 +52,298 @@ type DirectiveRoot struct { type ComplexityRoot struct { Book struct { - Author func(childComplexity int) int - ID func(childComplexity int) int - Title func(childComplexity int) int - User func(childComplexity int) int + Asin func(childComplexity int) int + Author func(childComplexity int) int + Copyright_date func(childComplexity int) int + Cover_image func(childComplexity int) int + Date_created func(childComplexity int) int + Date_updated func(childComplexity int) int + Default_user_id func(childComplexity int) int + Edition func(childComplexity int) int + Editor func(childComplexity int) int + Foreword func(childComplexity int) int + ID func(childComplexity int) int + Illustrator func(childComplexity int) int + Isbn_10 func(childComplexity int) int + Isbn_13 func(childComplexity int) int + Num_pages func(childComplexity int) int + Pub_date func(childComplexity int) int + Story_id func(childComplexity int) int + Sub_title func(childComplexity int) int + Synopsis func(childComplexity int) int + Title func(childComplexity int) int + Word_count func(childComplexity int) int + } + + Classroom struct { + ClassroomAvgLength func(childComplexity int) int + ClassroomDisplayName func(childComplexity int) int + ClassroomEndDate func(childComplexity int) int + ClassroomId func(childComplexity int) int + ClassroomName func(childComplexity int) int + ClassroomSchoolYear func(childComplexity int) int + ClassroomStartDate func(childComplexity int) int + ClassroomStatusID func(childComplexity int) int + ClassroomSubject func(childComplexity int) int + Classroom_avg_days func(childComplexity int) int + Classroom_co_teacher_id func(childComplexity int) int + Classroom_conf_frequency_above func(childComplexity int) int + Classroom_conf_frequency_below func(childComplexity int) int + Classroom_conf_frequency_far_below func(childComplexity int) int + Classroom_conf_frequency_on func(childComplexity int) int + Classroom_grade_level func(childComplexity int) int + Classroom_grade_level_type func(childComplexity int) int + Classroom_num_seats func(childComplexity int) int + Classroom_num_students func(childComplexity int) int + Classroom_school_id func(childComplexity int) int + Classroom_teacher_idV1 func(childComplexity int) int } Mutation struct { - CreateBook func(childComplexity int, input model.NewBook) int + CreateBook func(childComplexity int, input model.BookInput) int + CreateClassroom func(childComplexity int, input model.NewClassroom) int + CreateNewReadingRateResults func(childComplexity int, input model.NewReadingRateResults) int + CreateStudent func(childComplexity int, input model.NewStudent) int + CreateTeacher func(childComplexity int, input model.NewTeacher) int + UpdateBook func(childComplexity int, input *model.BookInput) int } Query struct { - Books func(childComplexity int) int + GetBookByIsbn func(childComplexity int, isbn int) int + GetUserByID func(childComplexity int, id string) int + Teachers func(childComplexity int) int + } + + ReadingRateResult struct { + Book_id func(childComplexity int) int + Check_in func(childComplexity int) int + Date func(childComplexity int) int + EndTime func(childComplexity int) int + End_page func(childComplexity int) int + Grade_level func(childComplexity int) int + Grade_level_status func(childComplexity int) int + Observational_notes func(childComplexity int) int + Reader_continuum func(childComplexity int) int + Reader_request func(childComplexity int) int + Reader_request_almost_finished func(childComplexity int) int + Reader_response func(childComplexity int) int + Reading_location func(childComplexity int) int + Reading_rate_results_id func(childComplexity int) int + Reading_response_pages func(childComplexity int) int + Reading_response_subtype func(childComplexity int) int + Reading_response_type func(childComplexity int) int + Reading_setting func(childComplexity int) int + Reading_type_details func(childComplexity int) int + Section_rating func(childComplexity int) int + Share_feedback func(childComplexity int) int + StartTime func(childComplexity int) int + Start_page func(childComplexity int) int + Teacher_id func(childComplexity int) int + Total_pages func(childComplexity int) int + Total_time func(childComplexity int) int + Type_of_reading func(childComplexity int) int + Types_of_reading func(childComplexity int) int + User_book_id func(childComplexity int) int + User_id func(childComplexity int) int + Word_per_page func(childComplexity int) int + Words_per_page func(childComplexity int) int + } + + Student struct { + Avatar func(childComplexity int) int + Backup_avatar func(childComplexity int) int + Birth_date func(childComplexity int) int + DateCreated func(childComplexity int) int + DateUpdated func(childComplexity int) int + Ethnicity func(childComplexity int) int + First_name func(childComplexity int) int + Gender func(childComplexity int) int + Grade_level func(childComplexity int) int + Grade_level_status func(childComplexity int) int + Grade_movement func(childComplexity int) int + Guided_reading_level func(childComplexity int) int + Id func(childComplexity int) int + Last_name func(childComplexity int) int + Lexile_level_max func(childComplexity int) int + Lexile_level_min func(childComplexity int) int + Middle_name func(childComplexity int) int + Preferred_name func(childComplexity int) int + Pronoun func(childComplexity int) int + Reader_type func(childComplexity int) int + Reading_stage func(childComplexity int) int + RtiSrvType func(childComplexity int) int + Rti_services func(childComplexity int) int + Specialized_courses func(childComplexity int) int + Student_app_id func(childComplexity int) int + Student_calpads_ssid func(childComplexity int) int + Student_id func(childComplexity int) int + Student_login_id func(childComplexity int) int + Student_services func(childComplexity int) int + Type func(childComplexity int) int + Weakness func(childComplexity int) int + } + + Teacher struct { + Active func(childComplexity int) int + Certification_end func(childComplexity int) int + Certification_id func(childComplexity int) int + Certification_start func(childComplexity int) int + Degree_level_id func(childComplexity int) int + Is_certified func(childComplexity int) int + Quarantined_books func(childComplexity int) int + TeacherDateCreated func(childComplexity int) int + TeacherDateOfBirth func(childComplexity int) int + TeacherDateUpdated func(childComplexity int) int + Teacher_avatar func(childComplexity int) int + Teacher_backup_avater func(childComplexity int) int + Teacher_backup_email func(childComplexity int) int + Teacher_cell_phone func(childComplexity int) int + Teacher_code_name func(childComplexity int) int + Teacher_date_started_teaching func(childComplexity int) int + Teacher_display_name func(childComplexity int) int + Teacher_district func(childComplexity int) int + Teacher_first_name func(childComplexity int) int + Teacher_gender func(childComplexity int) int + Teacher_grade_band func(childComplexity int) int + Teacher_id func(childComplexity int) int + Teacher_last_name func(childComplexity int) int + Teacher_login_id func(childComplexity int) int + Teacher_middle_name func(childComplexity int) int + Teacher_position func(childComplexity int) int + Teacher_pronoun func(childComplexity int) int + Teacher_provided_services func(childComplexity int) int + Teacher_school func(childComplexity int) int + Teacher_specialized_courses func(childComplexity int) int + Teacher_state_id func(childComplexity int) int + Teacher_subjects func(childComplexity int) int + Teacher_subscription_type func(childComplexity int) int + Teacher_suffix func(childComplexity int) int + Teacher_texts_enabled func(childComplexity int) int + Teacher_title func(childComplexity int) int } User struct { - Email func(childComplexity int) int - FirstName func(childComplexity int) int - ID func(childComplexity int) int - LastName func(childComplexity int) int + Avatar func(childComplexity int) int + BackupAvatar func(childComplexity int) int + BirthDate func(childComplexity int) int + BookFinish func(childComplexity int) int + DateCreated func(childComplexity int) int + DateUpdated func(childComplexity int) int + Ethnicity func(childComplexity int) int + FirstName func(childComplexity int) int + Gender func(childComplexity int) int + GradeLevel func(childComplexity int) int + GradeLevelStatus func(childComplexity int) int + GradeMovement func(childComplexity int) int + GuidedReadingLevel func(childComplexity int) int + ID func(childComplexity int) int + LastName func(childComplexity int) int + LexileLevelMax func(childComplexity int) int + LexileLevelMin func(childComplexity int) int + MiddleName func(childComplexity int) int + PreferredName func(childComplexity int) int + Pronoun func(childComplexity int) int + ReadGoal func(childComplexity int) int + ReadSpeed func(childComplexity int) int + ReaderNonReader func(childComplexity int) int + ReaderType func(childComplexity int) int + ReadingStage func(childComplexity int) int + RtiServices func(childComplexity int) int + RtiSrvType func(childComplexity int) int + SelfAssessment func(childComplexity int) int + SpecializedCourses func(childComplexity int) int + StudentAppID func(childComplexity int) int + StudentCalpadsSsid func(childComplexity int) int + StudentID func(childComplexity int) int + StudentLoginID func(childComplexity int) int + StudentServices func(childComplexity int) int + Type func(childComplexity int) int + TypeOfReading func(childComplexity int) int + Weakness func(childComplexity int) int + } + + UserBook struct { + Book_id func(childComplexity int) int + Book_type func(childComplexity int) int + Checkout_status func(childComplexity int) int + Condition func(childComplexity int) int + Cover_image func(childComplexity int) int + Current_user_id func(childComplexity int) int + Date_created func(childComplexity int) int + Date_updated func(childComplexity int) int + Entered_user_id func(childComplexity int) int + Format func(childComplexity int) int + Guided_reading_level func(childComplexity int) int + Id func(childComplexity int) int + Lexile_level func(childComplexity int) int + Location func(childComplexity int) int + Mentor_text func(childComplexity int) int + Multiple_pov func(childComplexity int) int + Own_this_copy func(childComplexity int) int + Price func(childComplexity int) int + QtyLabel func(childComplexity int) int + Series func(childComplexity int) int + Series_name func(childComplexity int) int + Series_pos func(childComplexity int) int + Tags func(childComplexity int) int + Teacher_notes func(childComplexity int) int + Teacher_read func(childComplexity int) int + Text_complexity func(childComplexity int) int + Unpaged func(childComplexity int) int + Unreliable_narrative func(childComplexity int) int + User_id func(childComplexity int) int + Want_for_classroom func(childComplexity int) int + Want_to_discard func(childComplexity int) int + Word_count func(childComplexity int) int + Words_per_page func(childComplexity int) int } } -type BookResolver interface { - Title(ctx context.Context, obj *model.Book) (string, error) - Author(ctx context.Context, obj *model.Book) (string, error) - User(ctx context.Context, obj *model.Book) (*model.User, error) +type ClassroomResolver interface { + ClassroomSchoolYear(ctx context.Context, obj *model.Classroom) (*string, error) + ClassroomStartDate(ctx context.Context, obj *model.Classroom) (*string, error) + ClassroomEndDate(ctx context.Context, obj *model.Classroom) (*string, error) + ClassroomName(ctx context.Context, obj *model.Classroom) (*string, error) + ClassroomSubject(ctx context.Context, obj *model.Classroom) (*string, error) + ClassroomDisplayName(ctx context.Context, obj *model.Classroom) (*string, error) + ClassroomAvgLength(ctx context.Context, obj *model.Classroom) (*string, error) + + ClassroomStatusID(ctx context.Context, obj *model.Classroom) (int, error) } type MutationResolver interface { - CreateBook(ctx context.Context, input model.NewBook) (*model.Book, error) + CreateBook(ctx context.Context, input model.BookInput) (*model.Book, error) + UpdateBook(ctx context.Context, input *model.BookInput) (*model.Book, error) + CreateTeacher(ctx context.Context, input model.NewTeacher) (*model.Teacher, error) + CreateClassroom(ctx context.Context, input model.NewClassroom) (*model.Classroom, error) + CreateStudent(ctx context.Context, input model.NewStudent) (*model.Student, error) + CreateNewReadingRateResults(ctx context.Context, input model.NewReadingRateResults) (*model.ReadingRateResult, error) } type QueryResolver interface { - Books(ctx context.Context) ([]*model.Book, error) + GetBookByIsbn(ctx context.Context, isbn int) (*model.Book, error) + Teachers(ctx context.Context) ([]*model.Teacher, error) + GetUserByID(ctx context.Context, id string) (*model.User, error) +} +type ReadingRateResultResolver interface { + Date(ctx context.Context, obj *model.ReadingRateResult) (*string, error) + + StartTime(ctx context.Context, obj *model.ReadingRateResult) (*string, error) + EndTime(ctx context.Context, obj *model.ReadingRateResult) (*string, error) +} +type StudentResolver interface { + DateCreated(ctx context.Context, obj *model.Student) (*string, error) + DateUpdated(ctx context.Context, obj *model.Student) (*string, error) + + RtiSrvType(ctx context.Context, obj *model.Student) (*int, error) +} +type TeacherResolver interface { + TeacherDateOfBirth(ctx context.Context, obj *model.Teacher) (*string, error) + + Active(ctx context.Context, obj *model.Teacher) (int, error) + TeacherDateCreated(ctx context.Context, obj *model.Teacher) (string, error) + TeacherDateUpdated(ctx context.Context, obj *model.Teacher) (*string, error) +} +type UserBookResolver interface { + QtyLabel(ctx context.Context, obj *model.UserBook) (*int, error) } type executableSchema struct { @@ -96,6 +361,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in _ = ec switch typeName + "." + field { + case "Book.asin": + if e.complexity.Book.Asin == nil { + break + } + + return e.complexity.Book.Asin(childComplexity), true + case "Book.author": if e.complexity.Book.Author == nil { break @@ -103,6 +375,62 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Book.Author(childComplexity), true + case "Book.copyright_date": + if e.complexity.Book.Copyright_date == nil { + break + } + + return e.complexity.Book.Copyright_date(childComplexity), true + + case "Book.cover_image": + if e.complexity.Book.Cover_image == nil { + break + } + + return e.complexity.Book.Cover_image(childComplexity), true + + case "Book.date_created": + if e.complexity.Book.Date_created == nil { + break + } + + return e.complexity.Book.Date_created(childComplexity), true + + case "Book.date_updated": + if e.complexity.Book.Date_updated == nil { + break + } + + return e.complexity.Book.Date_updated(childComplexity), true + + case "Book.default_user_id": + if e.complexity.Book.Default_user_id == nil { + break + } + + return e.complexity.Book.Default_user_id(childComplexity), true + + case "Book.edition": + if e.complexity.Book.Edition == nil { + break + } + + return e.complexity.Book.Edition(childComplexity), true + + case "Book.editor": + if e.complexity.Book.Editor == nil { + break + } + + return e.complexity.Book.Editor(childComplexity), true + + case "Book.foreword": + if e.complexity.Book.Foreword == nil { + break + } + + return e.complexity.Book.Foreword(childComplexity), true + case "Book.id": if e.complexity.Book.ID == nil { break @@ -110,2349 +438,13145 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Book.ID(childComplexity), true - case "Book.title": - if e.complexity.Book.Title == nil { + case "Book.illustrator": + if e.complexity.Book.Illustrator == nil { break } - return e.complexity.Book.Title(childComplexity), true + return e.complexity.Book.Illustrator(childComplexity), true - case "Book.user": - if e.complexity.Book.User == nil { + case "Book.isbn_10": + if e.complexity.Book.Isbn_10 == nil { break } - return e.complexity.Book.User(childComplexity), true + return e.complexity.Book.Isbn_10(childComplexity), true - case "Mutation.createBook": - if e.complexity.Mutation.CreateBook == nil { + case "Book.isbn_13": + if e.complexity.Book.Isbn_13 == nil { break } - args, err := ec.field_Mutation_createBook_args(context.TODO(), rawArgs) - if err != nil { - return 0, false + return e.complexity.Book.Isbn_13(childComplexity), true + + case "Book.num_pages": + if e.complexity.Book.Num_pages == nil { + break } - return e.complexity.Mutation.CreateBook(childComplexity, args["input"].(model.NewBook)), true + return e.complexity.Book.Num_pages(childComplexity), true - case "Query.books": - if e.complexity.Query.Books == nil { + case "Book.pub_date": + if e.complexity.Book.Pub_date == nil { break } - return e.complexity.Query.Books(childComplexity), true + return e.complexity.Book.Pub_date(childComplexity), true - case "User.email": - if e.complexity.User.Email == nil { + case "Book.story_id": + if e.complexity.Book.Story_id == nil { break } - return e.complexity.User.Email(childComplexity), true + return e.complexity.Book.Story_id(childComplexity), true - case "User.first_name": - if e.complexity.User.FirstName == nil { + case "Book.sub_title": + if e.complexity.Book.Sub_title == nil { break } - return e.complexity.User.FirstName(childComplexity), true + return e.complexity.Book.Sub_title(childComplexity), true - case "User.id": - if e.complexity.User.ID == nil { + case "Book.synopsis": + if e.complexity.Book.Synopsis == nil { break } - return e.complexity.User.ID(childComplexity), true + return e.complexity.Book.Synopsis(childComplexity), true - case "User.last_name": - if e.complexity.User.LastName == nil { + case "Book.title": + if e.complexity.Book.Title == nil { break } - return e.complexity.User.LastName(childComplexity), true + return e.complexity.Book.Title(childComplexity), true - } - return 0, false -} + case "Book.word_count": + if e.complexity.Book.Word_count == nil { + break + } -func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { - rc := graphql.GetOperationContext(ctx) - ec := executionContext{rc, e} - inputUnmarshalMap := graphql.BuildUnmarshalerMap( - ec.unmarshalInputNewBook, - ) - first := true + return e.complexity.Book.Word_count(childComplexity), 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) + case "Classroom.classroom_avg_length": + if e.complexity.Classroom.ClassroomAvgLength == nil { + break + } - return &graphql.Response{ - Data: buf.Bytes(), - } + return e.complexity.Classroom.ClassroomAvgLength(childComplexity), true + + case "Classroom.classroom_display_name": + if e.complexity.Classroom.ClassroomDisplayName == nil { + break } - case ast.Mutation: - return func(ctx context.Context) *graphql.Response { - if !first { - return nil - } - first = false - ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) - data := ec._Mutation(ctx, rc.Operation.SelectionSet) - var buf bytes.Buffer - data.MarshalGQL(&buf) - return &graphql.Response{ - Data: buf.Bytes(), - } + return e.complexity.Classroom.ClassroomDisplayName(childComplexity), true + + case "Classroom.classroom_end_date": + if e.complexity.Classroom.ClassroomEndDate == nil { + break } - default: - return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) - } -} + return e.complexity.Classroom.ClassroomEndDate(childComplexity), true -type executionContext struct { - *graphql.OperationContext - *executableSchema -} + case "Classroom.classroomId": + if e.complexity.Classroom.ClassroomId == nil { + break + } -func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { - if ec.DisableIntrospection { - return nil, errors.New("introspection disabled") - } - return introspection.WrapSchema(parsedSchema), nil -} + return e.complexity.Classroom.ClassroomId(childComplexity), true -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 -} + case "Classroom.classroom_name": + if e.complexity.Classroom.ClassroomName == nil { + break + } -//go:embed "schema.graphqls" -var sourcesFS embed.FS + return e.complexity.Classroom.ClassroomName(childComplexity), true -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) -} + case "Classroom.classroom_school_year": + if e.complexity.Classroom.ClassroomSchoolYear == nil { + break + } -var sources = []*ast.Source{ - {Name: "schema.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false}, -} -var parsedSchema = gqlparser.MustLoadSchema(sources...) + return e.complexity.Classroom.ClassroomSchoolYear(childComplexity), true -// endregion ************************** generated!.gotpl ************************** + case "Classroom.classroom_start_date": + if e.complexity.Classroom.ClassroomStartDate == nil { + break + } -// region ***************************** args.gotpl ***************************** + return e.complexity.Classroom.ClassroomStartDate(childComplexity), true -func (ec *executionContext) field_Mutation_createBook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { - var err error - args := map[string]interface{}{} - var arg0 model.NewBook - if tmp, ok := rawArgs["input"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) - arg0, err = ec.unmarshalNNewBook2remoᚋbackendᚋgraphᚋmodelᚐNewBook(ctx, tmp) - if err != nil { - return nil, err + case "Classroom.classroom_status_id": + if e.complexity.Classroom.ClassroomStatusID == nil { + break } - } - args["input"] = arg0 - return args, nil -} -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 + return e.complexity.Classroom.ClassroomStatusID(childComplexity), true + + case "Classroom.classroom_subject": + if e.complexity.Classroom.ClassroomSubject == nil { + break } - } - args["name"] = arg0 - 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 + return e.complexity.Classroom.ClassroomSubject(childComplexity), true + + case "Classroom.classroom_avg_days": + if e.complexity.Classroom.Classroom_avg_days == nil { + break } - } - 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 + return e.complexity.Classroom.Classroom_avg_days(childComplexity), true + + case "Classroom.classroom_co_teacher_id": + if e.complexity.Classroom.Classroom_co_teacher_id == nil { + break } - } - args["includeDeprecated"] = arg0 - return args, nil -} -// endregion ***************************** args.gotpl ***************************** + return e.complexity.Classroom.Classroom_co_teacher_id(childComplexity), true -// region ************************** directives.gotpl ************************** + case "Classroom.classroom_conf_frequency_above": + if e.complexity.Classroom.Classroom_conf_frequency_above == nil { + break + } -// endregion ************************** directives.gotpl ************************** + return e.complexity.Classroom.Classroom_conf_frequency_above(childComplexity), true -// region **************************** field.gotpl ***************************** + case "Classroom.classroom_conf_frequency_below": + if e.complexity.Classroom.Classroom_conf_frequency_below == nil { + break + } -func (ec *executionContext) _Book_id(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Book_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 + return e.complexity.Classroom.Classroom_conf_frequency_below(childComplexity), true + + case "Classroom.classroom_conf_frequency_far_below": + if e.complexity.Classroom.Classroom_conf_frequency_far_below == nil { + break } - }() - 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 e.complexity.Classroom.Classroom_conf_frequency_far_below(childComplexity), true + + case "Classroom.classroom_conf_frequency_on": + if e.complexity.Classroom.Classroom_conf_frequency_on == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Book_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Book", - 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 -} + return e.complexity.Classroom.Classroom_conf_frequency_on(childComplexity), true -func (ec *executionContext) _Book_title(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Book_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 + case "Classroom.classroom_grade_level": + if e.complexity.Classroom.Classroom_grade_level == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Book().Title(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 e.complexity.Classroom.Classroom_grade_level(childComplexity), true + + case "Classroom.classroom_grade_level_type": + if e.complexity.Classroom.Classroom_grade_level_type == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Book_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Book", - Field: field, - IsMethod: true, - IsResolver: true, - 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 -} + return e.complexity.Classroom.Classroom_grade_level_type(childComplexity), true -func (ec *executionContext) _Book_author(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Book_author(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 + case "Classroom.classroom_num_seats": + if e.complexity.Classroom.Classroom_num_seats == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Book().Author(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 e.complexity.Classroom.Classroom_num_seats(childComplexity), true + + case "Classroom.classroom_num_students": + if e.complexity.Classroom.Classroom_num_students == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Book_author(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Book", - Field: field, - IsMethod: true, - IsResolver: true, - 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 -} + return e.complexity.Classroom.Classroom_num_students(childComplexity), true -func (ec *executionContext) _Book_user(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Book_user(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 + case "Classroom.classroom_school_id": + if e.complexity.Classroom.Classroom_school_id == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Book().User(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 e.complexity.Classroom.Classroom_school_id(childComplexity), true + + case "Classroom.classroom_teacher_idV1": + if e.complexity.Classroom.Classroom_teacher_idV1 == nil { + break } - return graphql.Null - } - res := resTmp.(*model.User) - fc.Result = res - return ec.marshalNUser2ᚖremoᚋbackendᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Book_user(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Book", - 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_User_id(ctx, field) - case "first_name": - return ec.fieldContext_User_first_name(ctx, field) - case "last_name": - return ec.fieldContext_User_last_name(ctx, field) - case "email": - return ec.fieldContext_User_email(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type User", field.Name) - }, - } - return fc, nil -} + return e.complexity.Classroom.Classroom_teacher_idV1(childComplexity), true -func (ec *executionContext) _Mutation_createBook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Mutation_createBook(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 + case "Mutation.createBook": + if e.complexity.Mutation.CreateBook == nil { + break } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateBook(rctx, fc.Args["input"].(model.NewBook)) - }) - 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") + + args, err := ec.field_Mutation_createBook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(*model.Book) - fc.Result = res - return ec.marshalNBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Mutation_createBook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "Mutation", - 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_Book_id(ctx, field) - case "title": - return ec.fieldContext_Book_title(ctx, field) - case "author": - return ec.fieldContext_Book_author(ctx, field) - case "user": - return ec.fieldContext_Book_user(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Book", field.Name) - }, - } - defer func() { - if r := recover(); r != nil { - err = ec.Recover(ctx, r) - ec.Error(ctx, err) + return e.complexity.Mutation.CreateBook(childComplexity, args["input"].(model.BookInput)), true + + case "Mutation.createClassroom": + if e.complexity.Mutation.CreateClassroom == nil { + break } - }() - ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createBook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return - } - return fc, nil -} -func (ec *executionContext) _Query_books(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Query_books(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 + args, err := ec.field_Mutation_createClassroom_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - }() - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().Books(rctx) - }) - 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 e.complexity.Mutation.CreateClassroom(childComplexity, args["input"].(model.NewClassroom)), true + + case "Mutation.createNewReadingRateResults": + if e.complexity.Mutation.CreateNewReadingRateResults == nil { + break } - return graphql.Null - } - res := resTmp.([]*model.Book) - fc.Result = res - return ec.marshalNBook2ᚕᚖremoᚋbackendᚋgraphᚋmodelᚐBookᚄ(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_Query_books(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_Book_id(ctx, field) - case "title": - return ec.fieldContext_Book_title(ctx, field) - case "author": - return ec.fieldContext_Book_author(ctx, field) - case "user": - return ec.fieldContext_Book_user(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Book", field.Name) - }, - } - return fc, nil -} + args, err := ec.field_Mutation_createNewReadingRateResults_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -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 + return e.complexity.Mutation.CreateNewReadingRateResults(childComplexity, args["input"].(model.NewReadingRateResults)), true + + case "Mutation.createStudent": + if e.complexity.Mutation.CreateStudent == nil { + break } - }() - 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) + args, err := ec.field_Mutation_createStudent_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - }() - 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 + return e.complexity.Mutation.CreateStudent(childComplexity, args["input"].(model.NewStudent)), true + + case "Mutation.createTeacher": + if e.complexity.Mutation.CreateTeacher == nil { + break } - }() - 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 -} + args, err := ec.field_Mutation_createTeacher_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_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 + return e.complexity.Mutation.CreateTeacher(childComplexity, args["input"].(model.NewTeacher)), true + + case "Mutation.updateBook": + if e.complexity.Mutation.UpdateBook == nil { + break } - }() - 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") + + args, err := ec.field_Mutation_updateBook_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNID2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_User_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "User", - 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 -} + return e.complexity.Mutation.UpdateBook(childComplexity, args["input"].(*model.BookInput)), true -func (ec *executionContext) _User_first_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_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 + case "Query.getBookByISBN": + if e.complexity.Query.GetBookByIsbn == nil { + break } - }() - 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") + + args, err := ec.field_Query_getBookByISBN_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_User_first_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "User", - 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 -} + return e.complexity.Query.GetBookByIsbn(childComplexity, args["isbn"].(int)), true -func (ec *executionContext) _User_last_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_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 + case "Query.getUserByID": + if e.complexity.Query.GetUserByID == nil { + break } - }() - 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") + + args, err := ec.field_Query_getUserByID_args(context.TODO(), rawArgs) + if err != nil { + return 0, false } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_User_last_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "User", - 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 -} + return e.complexity.Query.GetUserByID(childComplexity, args["id"].(string)), true -func (ec *executionContext) _User_email(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_User_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 + case "Query.teachers": + if e.complexity.Query.Teachers == nil { + break } - }() - 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 e.complexity.Query.Teachers(childComplexity), true + + case "ReadingRateResult.book_id": + if e.complexity.ReadingRateResult.Book_id == nil { + break } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} -func (ec *executionContext) fieldContext_User_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { - fc = &graphql.FieldContext{ - Object: "User", - 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 -} + return e.complexity.ReadingRateResult.Book_id(childComplexity), true -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 + case "ReadingRateResult.check_in": + if e.complexity.ReadingRateResult.Check_in == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Check_in(childComplexity), true + + case "ReadingRateResult.date": + if e.complexity.ReadingRateResult.Date == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Date(childComplexity), true -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 + case "ReadingRateResult.end_time": + if e.complexity.ReadingRateResult.EndTime == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.EndTime(childComplexity), true -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 + case "ReadingRateResult.end_page": + if e.complexity.ReadingRateResult.End_page == nil { + break } - }() - 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 e.complexity.ReadingRateResult.End_page(childComplexity), true + + case "ReadingRateResult.grade_level": + if e.complexity.ReadingRateResult.Grade_level == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Grade_level(childComplexity), true -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 + case "ReadingRateResult.grade_level_status": + if e.complexity.ReadingRateResult.Grade_level_status == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Grade_level_status(childComplexity), true + + case "ReadingRateResult.observational_notes": + if e.complexity.ReadingRateResult.Observational_notes == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Observational_notes(childComplexity), true -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 + case "ReadingRateResult.reader_continuum": + if e.complexity.ReadingRateResult.Reader_continuum == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Reader_continuum(childComplexity), true + + case "ReadingRateResult.reader_request": + if e.complexity.ReadingRateResult.Reader_request == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Reader_request(childComplexity), true -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 + case "ReadingRateResult.reader_request_almost_finished": + if e.complexity.ReadingRateResult.Reader_request_almost_finished == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Reader_request_almost_finished(childComplexity), true + + case "ReadingRateResult.reader_response": + if e.complexity.ReadingRateResult.Reader_response == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Reader_response(childComplexity), true -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 + case "ReadingRateResult.reading_location": + if e.complexity.ReadingRateResult.Reading_location == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Reading_location(childComplexity), true -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 + case "ReadingRateResult.reading_rate_results_id": + if e.complexity.ReadingRateResult.Reading_rate_results_id == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Reading_rate_results_id(childComplexity), true + + case "ReadingRateResult.reading_response_pages": + if e.complexity.ReadingRateResult.Reading_response_pages == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Reading_response_pages(childComplexity), true -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 + case "ReadingRateResult.reading_response_subtype": + if e.complexity.ReadingRateResult.Reading_response_subtype == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Reading_response_subtype(childComplexity), true -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 + case "ReadingRateResult.reading_response_type": + if e.complexity.ReadingRateResult.Reading_response_type == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Reading_response_type(childComplexity), true + + case "ReadingRateResult.reading_setting": + if e.complexity.ReadingRateResult.Reading_setting == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Reading_setting(childComplexity), true -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 + case "ReadingRateResult.reading_type_details": + if e.complexity.ReadingRateResult.Reading_type_details == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Reading_type_details(childComplexity), true -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") + case "ReadingRateResult.section_rating": + if e.complexity.ReadingRateResult.Section_rating == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Section_rating(childComplexity), true -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 + case "ReadingRateResult.share_feedback": + if e.complexity.ReadingRateResult.Share_feedback == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Share_feedback(childComplexity), true + + case "ReadingRateResult.start_time": + if e.complexity.ReadingRateResult.StartTime == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.StartTime(childComplexity), true -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 + case "ReadingRateResult.start_page": + if e.complexity.ReadingRateResult.Start_page == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Start_page(childComplexity), true + + case "ReadingRateResult.teacher_id": + if e.complexity.ReadingRateResult.Teacher_id == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Teacher_id(childComplexity), true -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 + case "ReadingRateResult.total_pages": + if e.complexity.ReadingRateResult.Total_pages == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Total_pages(childComplexity), true -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 + case "ReadingRateResult.total_time": + if e.complexity.ReadingRateResult.Total_time == nil { + break } - }() - 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 e.complexity.ReadingRateResult.Total_time(childComplexity), true + + case "ReadingRateResult.type_of_reading": + if e.complexity.ReadingRateResult.Type_of_reading == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.Type_of_reading(childComplexity), true -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 + case "ReadingRateResult.types_of_reading": + if e.complexity.ReadingRateResult.Types_of_reading == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Types_of_reading(childComplexity), true -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 + case "ReadingRateResult.user_book_id": + if e.complexity.ReadingRateResult.User_book_id == nil { + break } - }() - 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 e.complexity.ReadingRateResult.User_book_id(childComplexity), true + + case "ReadingRateResult.user_id": + if e.complexity.ReadingRateResult.User_id == nil { + break } - 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 -} + return e.complexity.ReadingRateResult.User_id(childComplexity), true -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 + case "ReadingRateResult.word_per_page": + if e.complexity.ReadingRateResult.Word_per_page == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Word_per_page(childComplexity), true -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 + case "ReadingRateResult.words_per_page": + if e.complexity.ReadingRateResult.Words_per_page == nil { + break } - }() - 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 -} + return e.complexity.ReadingRateResult.Words_per_page(childComplexity), true -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 + case "Student.avatar": + if e.complexity.Student.Avatar == nil { + break } - }() - 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 e.complexity.Student.Avatar(childComplexity), true + + case "Student.backupAvatar": + if e.complexity.Student.Backup_avatar == nil { + break } - 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 -} + return e.complexity.Student.Backup_avatar(childComplexity), true -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 + case "Student.birthDate": + if e.complexity.Student.Birth_date == nil { + break } - }() - 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 e.complexity.Student.Birth_date(childComplexity), true + + case "Student.dateCreated": + if e.complexity.Student.DateCreated == nil { + break } - 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 -} + return e.complexity.Student.DateCreated(childComplexity), true -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 + case "Student.dateUpdated": + if e.complexity.Student.DateUpdated == nil { + break } - }() - 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 -} + return e.complexity.Student.DateUpdated(childComplexity), true -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 + case "Student.ethnicity": + if e.complexity.Student.Ethnicity == nil { + break } - }() - 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 -} + return e.complexity.Student.Ethnicity(childComplexity), true -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 + case "Student.firstName": + if e.complexity.Student.First_name == nil { + break } - }() - 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 e.complexity.Student.First_name(childComplexity), true + + case "Student.gender": + if e.complexity.Student.Gender == nil { + break } - 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 -} + return e.complexity.Student.Gender(childComplexity), true -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 + case "Student.gradeLevel": + if e.complexity.Student.Grade_level == nil { + break } - }() - 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 e.complexity.Student.Grade_level(childComplexity), true + + case "Student.gradeLevelStatus": + if e.complexity.Student.Grade_level_status == nil { + break } - 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 -} + return e.complexity.Student.Grade_level_status(childComplexity), true -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 + case "Student.gradeMovement": + if e.complexity.Student.Grade_movement == nil { + break } - }() - 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 -} + return e.complexity.Student.Grade_movement(childComplexity), true -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 + case "Student.guidedReadingLevel": + if e.complexity.Student.Guided_reading_level == nil { + break } - }() - 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 -} + return e.complexity.Student.Guided_reading_level(childComplexity), true -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 + case "Student.id": + if e.complexity.Student.Id == nil { + break } - }() - 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) + return e.complexity.Student.Id(childComplexity), true + + case "Student.lastName": + if e.complexity.Student.Last_name == nil { + break } - }() - 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 + return e.complexity.Student.Last_name(childComplexity), true + + case "Student.lexileLevelMax": + if e.complexity.Student.Lexile_level_max == nil { + break } - }() - 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 -} + return e.complexity.Student.Lexile_level_max(childComplexity), true -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 + case "Student.lexileLevelMin": + if e.complexity.Student.Lexile_level_min == nil { + break } - }() - 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) -} + + return e.complexity.Student.Lexile_level_min(childComplexity), true + + case "Student.middleName": + if e.complexity.Student.Middle_name == nil { + break + } + + return e.complexity.Student.Middle_name(childComplexity), true + + case "Student.preferredName": + if e.complexity.Student.Preferred_name == nil { + break + } + + return e.complexity.Student.Preferred_name(childComplexity), true + + case "Student.pronoun": + if e.complexity.Student.Pronoun == nil { + break + } + + return e.complexity.Student.Pronoun(childComplexity), true + + case "Student.readerType": + if e.complexity.Student.Reader_type == nil { + break + } + + return e.complexity.Student.Reader_type(childComplexity), true + + case "Student.readingStage": + if e.complexity.Student.Reading_stage == nil { + break + } + + return e.complexity.Student.Reading_stage(childComplexity), true + + case "Student.rtiSrvType": + if e.complexity.Student.RtiSrvType == nil { + break + } + + return e.complexity.Student.RtiSrvType(childComplexity), true + + case "Student.rtiServices": + if e.complexity.Student.Rti_services == nil { + break + } + + return e.complexity.Student.Rti_services(childComplexity), true + + case "Student.specializedCourses": + if e.complexity.Student.Specialized_courses == nil { + break + } + + return e.complexity.Student.Specialized_courses(childComplexity), true + + case "Student.studentAppId": + if e.complexity.Student.Student_app_id == nil { + break + } + + return e.complexity.Student.Student_app_id(childComplexity), true + + case "Student.studentCalpadsSsid": + if e.complexity.Student.Student_calpads_ssid == nil { + break + } + + return e.complexity.Student.Student_calpads_ssid(childComplexity), true + + case "Student.studentId": + if e.complexity.Student.Student_id == nil { + break + } + + return e.complexity.Student.Student_id(childComplexity), true + + case "Student.studentLoginId": + if e.complexity.Student.Student_login_id == nil { + break + } + + return e.complexity.Student.Student_login_id(childComplexity), true + + case "Student.studentServices": + if e.complexity.Student.Student_services == nil { + break + } + + return e.complexity.Student.Student_services(childComplexity), true + + case "Student.type": + if e.complexity.Student.Type == nil { + break + } + + return e.complexity.Student.Type(childComplexity), true + + case "Student.weakness": + if e.complexity.Student.Weakness == nil { + break + } + + return e.complexity.Student.Weakness(childComplexity), true + + case "Teacher.Active": + if e.complexity.Teacher.Active == nil { + break + } + + return e.complexity.Teacher.Active(childComplexity), true + + case "Teacher.Certification_end": + if e.complexity.Teacher.Certification_end == nil { + break + } + + return e.complexity.Teacher.Certification_end(childComplexity), true + + case "Teacher.Certification_id": + if e.complexity.Teacher.Certification_id == nil { + break + } + + return e.complexity.Teacher.Certification_id(childComplexity), true + + case "Teacher.Certification_start": + if e.complexity.Teacher.Certification_start == nil { + break + } + + return e.complexity.Teacher.Certification_start(childComplexity), true + + case "Teacher.Degree_level_id": + if e.complexity.Teacher.Degree_level_id == nil { + break + } + + return e.complexity.Teacher.Degree_level_id(childComplexity), true + + case "Teacher.Is_certified": + if e.complexity.Teacher.Is_certified == nil { + break + } + + return e.complexity.Teacher.Is_certified(childComplexity), true + + case "Teacher.Quarantined_books": + if e.complexity.Teacher.Quarantined_books == nil { + break + } + + return e.complexity.Teacher.Quarantined_books(childComplexity), true + + case "Teacher.Teacher_date_created": + if e.complexity.Teacher.TeacherDateCreated == nil { + break + } + + return e.complexity.Teacher.TeacherDateCreated(childComplexity), true + + case "Teacher.Teacher_date_of_birth": + if e.complexity.Teacher.TeacherDateOfBirth == nil { + break + } + + return e.complexity.Teacher.TeacherDateOfBirth(childComplexity), true + + case "Teacher.Teacher_date_updated": + if e.complexity.Teacher.TeacherDateUpdated == nil { + break + } + + return e.complexity.Teacher.TeacherDateUpdated(childComplexity), true + + case "Teacher.Teacher_avatar": + if e.complexity.Teacher.Teacher_avatar == nil { + break + } + + return e.complexity.Teacher.Teacher_avatar(childComplexity), true + + case "Teacher.Teacher_backup_avater": + if e.complexity.Teacher.Teacher_backup_avater == nil { + break + } + + return e.complexity.Teacher.Teacher_backup_avater(childComplexity), true + + case "Teacher.Teacher_backup_email": + if e.complexity.Teacher.Teacher_backup_email == nil { + break + } + + return e.complexity.Teacher.Teacher_backup_email(childComplexity), true + + case "Teacher.Teacher_cell_phone": + if e.complexity.Teacher.Teacher_cell_phone == nil { + break + } + + return e.complexity.Teacher.Teacher_cell_phone(childComplexity), true + + case "Teacher.Teacher_code_name": + if e.complexity.Teacher.Teacher_code_name == nil { + break + } + + return e.complexity.Teacher.Teacher_code_name(childComplexity), true + + case "Teacher.Teacher_date_started_teaching": + if e.complexity.Teacher.Teacher_date_started_teaching == nil { + break + } + + return e.complexity.Teacher.Teacher_date_started_teaching(childComplexity), true + + case "Teacher.Teacher_display_name": + if e.complexity.Teacher.Teacher_display_name == nil { + break + } + + return e.complexity.Teacher.Teacher_display_name(childComplexity), true + + case "Teacher.Teacher_district": + if e.complexity.Teacher.Teacher_district == nil { + break + } + + return e.complexity.Teacher.Teacher_district(childComplexity), true + + case "Teacher.Teacher_first_name": + if e.complexity.Teacher.Teacher_first_name == nil { + break + } + + return e.complexity.Teacher.Teacher_first_name(childComplexity), true + + case "Teacher.Teacher_gender": + if e.complexity.Teacher.Teacher_gender == nil { + break + } + + return e.complexity.Teacher.Teacher_gender(childComplexity), true + + case "Teacher.Teacher_grade_band": + if e.complexity.Teacher.Teacher_grade_band == nil { + break + } + + return e.complexity.Teacher.Teacher_grade_band(childComplexity), true + + case "Teacher.teacher_ID": + if e.complexity.Teacher.Teacher_id == nil { + break + } + + return e.complexity.Teacher.Teacher_id(childComplexity), true + + case "Teacher.Teacher_last_name": + if e.complexity.Teacher.Teacher_last_name == nil { + break + } + + return e.complexity.Teacher.Teacher_last_name(childComplexity), true + + case "Teacher.Teacher_login_id": + if e.complexity.Teacher.Teacher_login_id == nil { + break + } + + return e.complexity.Teacher.Teacher_login_id(childComplexity), true + + case "Teacher.Teacher_middle_name": + if e.complexity.Teacher.Teacher_middle_name == nil { + break + } + + return e.complexity.Teacher.Teacher_middle_name(childComplexity), true + + case "Teacher.Teacher_position": + if e.complexity.Teacher.Teacher_position == nil { + break + } + + return e.complexity.Teacher.Teacher_position(childComplexity), true + + case "Teacher.Teacher_pronoun": + if e.complexity.Teacher.Teacher_pronoun == nil { + break + } + + return e.complexity.Teacher.Teacher_pronoun(childComplexity), true + + case "Teacher.Teacher_provided_services": + if e.complexity.Teacher.Teacher_provided_services == nil { + break + } + + return e.complexity.Teacher.Teacher_provided_services(childComplexity), true + + case "Teacher.Teacher_school": + if e.complexity.Teacher.Teacher_school == nil { + break + } + + return e.complexity.Teacher.Teacher_school(childComplexity), true + + case "Teacher.Teacher_specialized_courses": + if e.complexity.Teacher.Teacher_specialized_courses == nil { + break + } + + return e.complexity.Teacher.Teacher_specialized_courses(childComplexity), true + + case "Teacher.Teacher_state_id": + if e.complexity.Teacher.Teacher_state_id == nil { + break + } + + return e.complexity.Teacher.Teacher_state_id(childComplexity), true + + case "Teacher.Teacher_subjects": + if e.complexity.Teacher.Teacher_subjects == nil { + break + } + + return e.complexity.Teacher.Teacher_subjects(childComplexity), true + + case "Teacher.Teacher_subscription_type": + if e.complexity.Teacher.Teacher_subscription_type == nil { + break + } + + return e.complexity.Teacher.Teacher_subscription_type(childComplexity), true + + case "Teacher.Teacher_suffix": + if e.complexity.Teacher.Teacher_suffix == nil { + break + } + + return e.complexity.Teacher.Teacher_suffix(childComplexity), true + + case "Teacher.Teacher_texts_enabled": + if e.complexity.Teacher.Teacher_texts_enabled == nil { + break + } + + return e.complexity.Teacher.Teacher_texts_enabled(childComplexity), true + + case "Teacher.Teacher_title": + if e.complexity.Teacher.Teacher_title == nil { + break + } + + return e.complexity.Teacher.Teacher_title(childComplexity), true + + case "User.avatar": + if e.complexity.User.Avatar == nil { + break + } + + return e.complexity.User.Avatar(childComplexity), true + + case "User.backup_avatar": + if e.complexity.User.BackupAvatar == nil { + break + } + + return e.complexity.User.BackupAvatar(childComplexity), true + + case "User.birth_date": + if e.complexity.User.BirthDate == nil { + break + } + + return e.complexity.User.BirthDate(childComplexity), true + + case "User.book_finish": + if e.complexity.User.BookFinish == nil { + break + } + + return e.complexity.User.BookFinish(childComplexity), true + + case "User.date_created": + if e.complexity.User.DateCreated == nil { + break + } + + return e.complexity.User.DateCreated(childComplexity), true + + case "User.date_updated": + if e.complexity.User.DateUpdated == nil { + break + } + + return e.complexity.User.DateUpdated(childComplexity), true + + case "User.ethnicity": + if e.complexity.User.Ethnicity == nil { + break + } + + return e.complexity.User.Ethnicity(childComplexity), true + + case "User.first_name": + if e.complexity.User.FirstName == nil { + break + } + + return e.complexity.User.FirstName(childComplexity), true + + case "User.gender": + if e.complexity.User.Gender == nil { + break + } + + return e.complexity.User.Gender(childComplexity), true + + case "User.grade_level": + if e.complexity.User.GradeLevel == nil { + break + } + + return e.complexity.User.GradeLevel(childComplexity), true + + case "User.grade_level_status": + if e.complexity.User.GradeLevelStatus == nil { + break + } + + return e.complexity.User.GradeLevelStatus(childComplexity), true + + case "User.grade_movement": + if e.complexity.User.GradeMovement == nil { + break + } + + return e.complexity.User.GradeMovement(childComplexity), true + + case "User.guided_reading_level": + if e.complexity.User.GuidedReadingLevel == nil { + break + } + + return e.complexity.User.GuidedReadingLevel(childComplexity), true + + case "User.id": + if e.complexity.User.ID == nil { + break + } + + return e.complexity.User.ID(childComplexity), true + + case "User.last_name": + if e.complexity.User.LastName == nil { + break + } + + return e.complexity.User.LastName(childComplexity), true + + case "User.lexile_level_max": + if e.complexity.User.LexileLevelMax == nil { + break + } + + return e.complexity.User.LexileLevelMax(childComplexity), true + + case "User.lexile_level_min": + if e.complexity.User.LexileLevelMin == nil { + break + } + + return e.complexity.User.LexileLevelMin(childComplexity), true + + case "User.middle_name": + if e.complexity.User.MiddleName == nil { + break + } + + return e.complexity.User.MiddleName(childComplexity), true + + case "User.preferred_name": + if e.complexity.User.PreferredName == nil { + break + } + + return e.complexity.User.PreferredName(childComplexity), true + + case "User.pronoun": + if e.complexity.User.Pronoun == nil { + break + } + + return e.complexity.User.Pronoun(childComplexity), true + + case "User.read_goal": + if e.complexity.User.ReadGoal == nil { + break + } + + return e.complexity.User.ReadGoal(childComplexity), true + + case "User.read_speed": + if e.complexity.User.ReadSpeed == nil { + break + } + + return e.complexity.User.ReadSpeed(childComplexity), true + + case "User.reader_non_reader": + if e.complexity.User.ReaderNonReader == nil { + break + } + + return e.complexity.User.ReaderNonReader(childComplexity), true + + case "User.reader_type": + if e.complexity.User.ReaderType == nil { + break + } + + return e.complexity.User.ReaderType(childComplexity), true + + case "User.reading_stage": + if e.complexity.User.ReadingStage == nil { + break + } + + return e.complexity.User.ReadingStage(childComplexity), true + + case "User.rti_services": + if e.complexity.User.RtiServices == nil { + break + } + + return e.complexity.User.RtiServices(childComplexity), true + + case "User.rti_srv_type": + if e.complexity.User.RtiSrvType == nil { + break + } + + return e.complexity.User.RtiSrvType(childComplexity), true + + case "User.self_assessment": + if e.complexity.User.SelfAssessment == nil { + break + } + + return e.complexity.User.SelfAssessment(childComplexity), true + + case "User.specialized_courses": + if e.complexity.User.SpecializedCourses == nil { + break + } + + return e.complexity.User.SpecializedCourses(childComplexity), true + + case "User.student_app_id": + if e.complexity.User.StudentAppID == nil { + break + } + + return e.complexity.User.StudentAppID(childComplexity), true + + case "User.student_calpads_ssid": + if e.complexity.User.StudentCalpadsSsid == nil { + break + } + + return e.complexity.User.StudentCalpadsSsid(childComplexity), true + + case "User.student_id": + if e.complexity.User.StudentID == nil { + break + } + + return e.complexity.User.StudentID(childComplexity), true + + case "User.student_login_id": + if e.complexity.User.StudentLoginID == nil { + break + } + + return e.complexity.User.StudentLoginID(childComplexity), true + + case "User.student_services": + if e.complexity.User.StudentServices == nil { + break + } + + return e.complexity.User.StudentServices(childComplexity), true + + case "User.type": + if e.complexity.User.Type == nil { + break + } + + return e.complexity.User.Type(childComplexity), true + + case "User.type_of_reading": + if e.complexity.User.TypeOfReading == nil { + break + } + + return e.complexity.User.TypeOfReading(childComplexity), true + + case "User.weakness": + if e.complexity.User.Weakness == nil { + break + } + + return e.complexity.User.Weakness(childComplexity), true + + case "UserBook.book_id": + if e.complexity.UserBook.Book_id == nil { + break + } + + return e.complexity.UserBook.Book_id(childComplexity), true + + case "UserBook.book_type": + if e.complexity.UserBook.Book_type == nil { + break + } + + return e.complexity.UserBook.Book_type(childComplexity), true + + case "UserBook.checkout_status": + if e.complexity.UserBook.Checkout_status == nil { + break + } + + return e.complexity.UserBook.Checkout_status(childComplexity), true + + case "UserBook.condition": + if e.complexity.UserBook.Condition == nil { + break + } + + return e.complexity.UserBook.Condition(childComplexity), true + + case "UserBook.cover_image": + if e.complexity.UserBook.Cover_image == nil { + break + } + + return e.complexity.UserBook.Cover_image(childComplexity), true + + case "UserBook.current_user_id": + if e.complexity.UserBook.Current_user_id == nil { + break + } + + return e.complexity.UserBook.Current_user_id(childComplexity), true + + case "UserBook.date_created": + if e.complexity.UserBook.Date_created == nil { + break + } + + return e.complexity.UserBook.Date_created(childComplexity), true + + case "UserBook.date_updated": + if e.complexity.UserBook.Date_updated == nil { + break + } + + return e.complexity.UserBook.Date_updated(childComplexity), true + + case "UserBook.entered_user_id": + if e.complexity.UserBook.Entered_user_id == nil { + break + } + + return e.complexity.UserBook.Entered_user_id(childComplexity), true + + case "UserBook.format": + if e.complexity.UserBook.Format == nil { + break + } + + return e.complexity.UserBook.Format(childComplexity), true + + case "UserBook.guided_reading_level": + if e.complexity.UserBook.Guided_reading_level == nil { + break + } + + return e.complexity.UserBook.Guided_reading_level(childComplexity), true + + case "UserBook.id": + if e.complexity.UserBook.Id == nil { + break + } + + return e.complexity.UserBook.Id(childComplexity), true + + case "UserBook.lexile_level": + if e.complexity.UserBook.Lexile_level == nil { + break + } + + return e.complexity.UserBook.Lexile_level(childComplexity), true + + case "UserBook.location": + if e.complexity.UserBook.Location == nil { + break + } + + return e.complexity.UserBook.Location(childComplexity), true + + case "UserBook.mentor_text": + if e.complexity.UserBook.Mentor_text == nil { + break + } + + return e.complexity.UserBook.Mentor_text(childComplexity), true + + case "UserBook.multiple_pov": + if e.complexity.UserBook.Multiple_pov == nil { + break + } + + return e.complexity.UserBook.Multiple_pov(childComplexity), true + + case "UserBook.own_this_copy": + if e.complexity.UserBook.Own_this_copy == nil { + break + } + + return e.complexity.UserBook.Own_this_copy(childComplexity), true + + case "UserBook.price": + if e.complexity.UserBook.Price == nil { + break + } + + return e.complexity.UserBook.Price(childComplexity), true + + case "UserBook.qty_label": + if e.complexity.UserBook.QtyLabel == nil { + break + } + + return e.complexity.UserBook.QtyLabel(childComplexity), true + + case "UserBook.series": + if e.complexity.UserBook.Series == nil { + break + } + + return e.complexity.UserBook.Series(childComplexity), true + + case "UserBook.series_name": + if e.complexity.UserBook.Series_name == nil { + break + } + + return e.complexity.UserBook.Series_name(childComplexity), true + + case "UserBook.series_pos": + if e.complexity.UserBook.Series_pos == nil { + break + } + + return e.complexity.UserBook.Series_pos(childComplexity), true + + case "UserBook.tags": + if e.complexity.UserBook.Tags == nil { + break + } + + return e.complexity.UserBook.Tags(childComplexity), true + + case "UserBook.teacher_notes": + if e.complexity.UserBook.Teacher_notes == nil { + break + } + + return e.complexity.UserBook.Teacher_notes(childComplexity), true + + case "UserBook.teacher_read": + if e.complexity.UserBook.Teacher_read == nil { + break + } + + return e.complexity.UserBook.Teacher_read(childComplexity), true + + case "UserBook.text_complexity": + if e.complexity.UserBook.Text_complexity == nil { + break + } + + return e.complexity.UserBook.Text_complexity(childComplexity), true + + case "UserBook.unpaged": + if e.complexity.UserBook.Unpaged == nil { + break + } + + return e.complexity.UserBook.Unpaged(childComplexity), true + + case "UserBook.unreliable_narrative": + if e.complexity.UserBook.Unreliable_narrative == nil { + break + } + + return e.complexity.UserBook.Unreliable_narrative(childComplexity), true + + case "UserBook.user_id": + if e.complexity.UserBook.User_id == nil { + break + } + + return e.complexity.UserBook.User_id(childComplexity), true + + case "UserBook.want_for_classroom": + if e.complexity.UserBook.Want_for_classroom == nil { + break + } + + return e.complexity.UserBook.Want_for_classroom(childComplexity), true + + case "UserBook.want_to_discard": + if e.complexity.UserBook.Want_to_discard == nil { + break + } + + return e.complexity.UserBook.Want_to_discard(childComplexity), true + + case "UserBook.word_count": + if e.complexity.UserBook.Word_count == nil { + break + } + + return e.complexity.UserBook.Word_count(childComplexity), true + + case "UserBook.words_per_page": + if e.complexity.UserBook.Words_per_page == nil { + break + } + + return e.complexity.UserBook.Words_per_page(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( + ec.unmarshalInputBookInput, + ec.unmarshalInputNewClassroom, + ec.unmarshalInputNewStudent, + ec.unmarshalInputNewTeacher, + ec.unmarshalInputnewReadingRateResults, + ) + 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(), + } + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + ctx = graphql.WithUnmarshalerMap(ctx, inputUnmarshalMap) + data := ec._Mutation(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.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.graphqls", Input: sourceData("schema.graphqls"), BuiltIn: false}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_createBook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.BookInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNBookInput2remoᚋbackendᚋgraphᚋmodelᚐBookInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createClassroom_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.NewClassroom + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNNewClassroom2remoᚋbackendᚋgraphᚋmodelᚐNewClassroom(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createNewReadingRateResults_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.NewReadingRateResults + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNnewReadingRateResults2remoᚋbackendᚋgraphᚋmodelᚐNewReadingRateResults(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createStudent_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.NewStudent + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNNewStudent2remoᚋbackendᚋgraphᚋmodelᚐNewStudent(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createTeacher_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 model.NewTeacher + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNNewTeacher2remoᚋbackendᚋgraphᚋmodelᚐNewTeacher(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateBook_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *model.BookInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalOBookInput2ᚖremoᚋbackendᚋgraphᚋmodelᚐBookInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +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_getBookByISBN_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int + if tmp, ok := rawArgs["isbn"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isbn")) + arg0, err = ec.unmarshalNInt2int(ctx, tmp) + if err != nil { + return nil, err + } + } + args["isbn"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_getUserByID_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___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) _Book_id(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_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_Book_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_story_id(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_story_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.Story_id, 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.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_story_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_author(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_author(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.Author, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_author(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_cover_image(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_cover_image(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.Cover_image, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_cover_image(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_date_created(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_date_created(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.Date_created, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_date_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Book_date_updated(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_date_updated(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.Date_updated, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_date_updated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Book_default_user_id(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_default_user_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.Default_user_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_Book_default_user_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_foreword(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_foreword(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.Foreword, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_foreword(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_editor(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_editor(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.Editor, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_editor(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_illustrator(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_illustrator(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.Illustrator, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_illustrator(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_isbn_10(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_isbn_10(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.Isbn_10, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_isbn_10(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_isbn_13(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_isbn_13(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.Isbn_13, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_isbn_13(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_num_pages(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_num_pages(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.Num_pages, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_num_pages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_pub_date(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_pub_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.Pub_date, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_pub_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_copyright_date(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_copyright_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.Copyright_date, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_copyright_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_edition(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_edition(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.Edition, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_edition(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_synopsis(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_synopsis(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.Synopsis, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_synopsis(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_title(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_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 { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_word_count(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_word_count(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.Word_count, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_word_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_sub_title(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_sub_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.Sub_title, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_sub_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Book_asin(ctx context.Context, field graphql.CollectedField, obj *model.Book) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Book_asin(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.Asin, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Book_asin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Book", + 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) _Classroom_classroomId(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroomId(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.ClassroomId, 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_Classroom_classroomId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_school_id(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_school_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.Classroom_school_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_school_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_school_year(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_school_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 ec.resolvers.Classroom().ClassroomSchoolYear(rctx, obj) + }) + 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_Classroom_classroom_school_year(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_start_date(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_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 ec.resolvers.Classroom().ClassroomStartDate(rctx, obj) + }) + 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_Classroom_classroom_start_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_end_date(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_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 ec.resolvers.Classroom().ClassroomEndDate(rctx, obj) + }) + 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_Classroom_classroom_end_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_name(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_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 ec.resolvers.Classroom().ClassroomName(rctx, obj) + }) + 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_Classroom_classroom_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_subject(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_subject(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.Classroom().ClassroomSubject(rctx, obj) + }) + 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_Classroom_classroom_subject(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_display_name(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_display_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 ec.resolvers.Classroom().ClassroomDisplayName(rctx, obj) + }) + 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_Classroom_classroom_display_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_avg_length(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_avg_length(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.Classroom().ClassroomAvgLength(rctx, obj) + }) + 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_Classroom_classroom_avg_length(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_avg_days(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_avg_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.Classroom_avg_days, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_avg_days(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_grade_level_type(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_grade_level_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.Classroom_grade_level_type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_grade_level_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_grade_level(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_grade_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.Classroom_grade_level, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_grade_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_co_teacher_id(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_co_teacher_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.Classroom_co_teacher_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_co_teacher_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_teacher_idV1(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_teacher_idV1(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.Classroom_teacher_idV1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_teacher_idV1(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_num_students(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_num_students(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.Classroom_num_students, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_num_students(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_num_seats(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_num_seats(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.Classroom_num_seats, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_num_seats(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_status_id(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_status_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 ec.resolvers.Classroom().ClassroomStatusID(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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_status_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Classroom_classroom_conf_frequency_above(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_conf_frequency_above(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.Classroom_conf_frequency_above, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_conf_frequency_above(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_conf_frequency_on(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_conf_frequency_on(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.Classroom_conf_frequency_on, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_conf_frequency_on(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_conf_frequency_below(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_conf_frequency_below(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.Classroom_conf_frequency_below, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_conf_frequency_below(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Classroom_classroom_conf_frequency_far_below(ctx context.Context, field graphql.CollectedField, obj *model.Classroom) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Classroom_classroom_conf_frequency_far_below(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.Classroom_conf_frequency_far_below, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Classroom_classroom_conf_frequency_far_below(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Classroom", + 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) _Mutation_createBook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createBook(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.Mutation().CreateBook(rctx, fc.Args["input"].(model.BookInput)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Book) + fc.Result = res + return ec.marshalNBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createBook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + 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_Book_id(ctx, field) + case "story_id": + return ec.fieldContext_Book_story_id(ctx, field) + case "author": + return ec.fieldContext_Book_author(ctx, field) + case "cover_image": + return ec.fieldContext_Book_cover_image(ctx, field) + case "date_created": + return ec.fieldContext_Book_date_created(ctx, field) + case "date_updated": + return ec.fieldContext_Book_date_updated(ctx, field) + case "default_user_id": + return ec.fieldContext_Book_default_user_id(ctx, field) + case "foreword": + return ec.fieldContext_Book_foreword(ctx, field) + case "editor": + return ec.fieldContext_Book_editor(ctx, field) + case "illustrator": + return ec.fieldContext_Book_illustrator(ctx, field) + case "isbn_10": + return ec.fieldContext_Book_isbn_10(ctx, field) + case "isbn_13": + return ec.fieldContext_Book_isbn_13(ctx, field) + case "num_pages": + return ec.fieldContext_Book_num_pages(ctx, field) + case "pub_date": + return ec.fieldContext_Book_pub_date(ctx, field) + case "copyright_date": + return ec.fieldContext_Book_copyright_date(ctx, field) + case "edition": + return ec.fieldContext_Book_edition(ctx, field) + case "synopsis": + return ec.fieldContext_Book_synopsis(ctx, field) + case "title": + return ec.fieldContext_Book_title(ctx, field) + case "word_count": + return ec.fieldContext_Book_word_count(ctx, field) + case "sub_title": + return ec.fieldContext_Book_sub_title(ctx, field) + case "asin": + return ec.fieldContext_Book_asin(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Book", 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_Mutation_createBook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_updateBook(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_updateBook(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.Mutation().UpdateBook(rctx, fc.Args["input"].(*model.BookInput)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Book) + fc.Result = res + return ec.marshalOBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_updateBook(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + 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_Book_id(ctx, field) + case "story_id": + return ec.fieldContext_Book_story_id(ctx, field) + case "author": + return ec.fieldContext_Book_author(ctx, field) + case "cover_image": + return ec.fieldContext_Book_cover_image(ctx, field) + case "date_created": + return ec.fieldContext_Book_date_created(ctx, field) + case "date_updated": + return ec.fieldContext_Book_date_updated(ctx, field) + case "default_user_id": + return ec.fieldContext_Book_default_user_id(ctx, field) + case "foreword": + return ec.fieldContext_Book_foreword(ctx, field) + case "editor": + return ec.fieldContext_Book_editor(ctx, field) + case "illustrator": + return ec.fieldContext_Book_illustrator(ctx, field) + case "isbn_10": + return ec.fieldContext_Book_isbn_10(ctx, field) + case "isbn_13": + return ec.fieldContext_Book_isbn_13(ctx, field) + case "num_pages": + return ec.fieldContext_Book_num_pages(ctx, field) + case "pub_date": + return ec.fieldContext_Book_pub_date(ctx, field) + case "copyright_date": + return ec.fieldContext_Book_copyright_date(ctx, field) + case "edition": + return ec.fieldContext_Book_edition(ctx, field) + case "synopsis": + return ec.fieldContext_Book_synopsis(ctx, field) + case "title": + return ec.fieldContext_Book_title(ctx, field) + case "word_count": + return ec.fieldContext_Book_word_count(ctx, field) + case "sub_title": + return ec.fieldContext_Book_sub_title(ctx, field) + case "asin": + return ec.fieldContext_Book_asin(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Book", 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_Mutation_updateBook_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createTeacher(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createTeacher(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.Mutation().CreateTeacher(rctx, fc.Args["input"].(model.NewTeacher)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Teacher) + fc.Result = res + return ec.marshalNTeacher2ᚖremoᚋbackendᚋgraphᚋmodelᚐTeacher(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createTeacher(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "teacher_ID": + return ec.fieldContext_Teacher_teacher_ID(ctx, field) + case "Teacher_login_id": + return ec.fieldContext_Teacher_Teacher_login_id(ctx, field) + case "Teacher_title": + return ec.fieldContext_Teacher_Teacher_title(ctx, field) + case "Teacher_first_name": + return ec.fieldContext_Teacher_Teacher_first_name(ctx, field) + case "Teacher_middle_name": + return ec.fieldContext_Teacher_Teacher_middle_name(ctx, field) + case "Teacher_last_name": + return ec.fieldContext_Teacher_Teacher_last_name(ctx, field) + case "Teacher_suffix": + return ec.fieldContext_Teacher_Teacher_suffix(ctx, field) + case "Teacher_date_of_birth": + return ec.fieldContext_Teacher_Teacher_date_of_birth(ctx, field) + case "Teacher_date_started_teaching": + return ec.fieldContext_Teacher_Teacher_date_started_teaching(ctx, field) + case "Degree_level_id": + return ec.fieldContext_Teacher_Degree_level_id(ctx, field) + case "Is_certified": + return ec.fieldContext_Teacher_Is_certified(ctx, field) + case "Certification_id": + return ec.fieldContext_Teacher_Certification_id(ctx, field) + case "Certification_start": + return ec.fieldContext_Teacher_Certification_start(ctx, field) + case "Certification_end": + return ec.fieldContext_Teacher_Certification_end(ctx, field) + case "Teacher_avatar": + return ec.fieldContext_Teacher_Teacher_avatar(ctx, field) + case "Teacher_backup_avater": + return ec.fieldContext_Teacher_Teacher_backup_avater(ctx, field) + case "Teacher_subscription_type": + return ec.fieldContext_Teacher_Teacher_subscription_type(ctx, field) + case "Teacher_code_name": + return ec.fieldContext_Teacher_Teacher_code_name(ctx, field) + case "Teacher_display_name": + return ec.fieldContext_Teacher_Teacher_display_name(ctx, field) + case "Quarantined_books": + return ec.fieldContext_Teacher_Quarantined_books(ctx, field) + case "Teacher_backup_email": + return ec.fieldContext_Teacher_Teacher_backup_email(ctx, field) + case "Teacher_gender": + return ec.fieldContext_Teacher_Teacher_gender(ctx, field) + case "Teacher_pronoun": + return ec.fieldContext_Teacher_Teacher_pronoun(ctx, field) + case "Teacher_position": + return ec.fieldContext_Teacher_Teacher_position(ctx, field) + case "Teacher_grade_band": + return ec.fieldContext_Teacher_Teacher_grade_band(ctx, field) + case "Teacher_subjects": + return ec.fieldContext_Teacher_Teacher_subjects(ctx, field) + case "Teacher_provided_services": + return ec.fieldContext_Teacher_Teacher_provided_services(ctx, field) + case "Teacher_specialized_courses": + return ec.fieldContext_Teacher_Teacher_specialized_courses(ctx, field) + case "Teacher_state_id": + return ec.fieldContext_Teacher_Teacher_state_id(ctx, field) + case "Teacher_district": + return ec.fieldContext_Teacher_Teacher_district(ctx, field) + case "Teacher_school": + return ec.fieldContext_Teacher_Teacher_school(ctx, field) + case "Teacher_cell_phone": + return ec.fieldContext_Teacher_Teacher_cell_phone(ctx, field) + case "Teacher_texts_enabled": + return ec.fieldContext_Teacher_Teacher_texts_enabled(ctx, field) + case "Active": + return ec.fieldContext_Teacher_Active(ctx, field) + case "Teacher_date_created": + return ec.fieldContext_Teacher_Teacher_date_created(ctx, field) + case "Teacher_date_updated": + return ec.fieldContext_Teacher_Teacher_date_updated(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", 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_Mutation_createTeacher_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createClassroom(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createClassroom(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.Mutation().CreateClassroom(rctx, fc.Args["input"].(model.NewClassroom)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Classroom) + fc.Result = res + return ec.marshalNClassroom2ᚖremoᚋbackendᚋgraphᚋmodelᚐClassroom(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createClassroom(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "classroomId": + return ec.fieldContext_Classroom_classroomId(ctx, field) + case "classroom_school_id": + return ec.fieldContext_Classroom_classroom_school_id(ctx, field) + case "classroom_school_year": + return ec.fieldContext_Classroom_classroom_school_year(ctx, field) + case "classroom_start_date": + return ec.fieldContext_Classroom_classroom_start_date(ctx, field) + case "classroom_end_date": + return ec.fieldContext_Classroom_classroom_end_date(ctx, field) + case "classroom_name": + return ec.fieldContext_Classroom_classroom_name(ctx, field) + case "classroom_subject": + return ec.fieldContext_Classroom_classroom_subject(ctx, field) + case "classroom_display_name": + return ec.fieldContext_Classroom_classroom_display_name(ctx, field) + case "classroom_avg_length": + return ec.fieldContext_Classroom_classroom_avg_length(ctx, field) + case "classroom_avg_days": + return ec.fieldContext_Classroom_classroom_avg_days(ctx, field) + case "classroom_grade_level_type": + return ec.fieldContext_Classroom_classroom_grade_level_type(ctx, field) + case "classroom_grade_level": + return ec.fieldContext_Classroom_classroom_grade_level(ctx, field) + case "classroom_co_teacher_id": + return ec.fieldContext_Classroom_classroom_co_teacher_id(ctx, field) + case "classroom_teacher_idV1": + return ec.fieldContext_Classroom_classroom_teacher_idV1(ctx, field) + case "classroom_num_students": + return ec.fieldContext_Classroom_classroom_num_students(ctx, field) + case "classroom_num_seats": + return ec.fieldContext_Classroom_classroom_num_seats(ctx, field) + case "classroom_status_id": + return ec.fieldContext_Classroom_classroom_status_id(ctx, field) + case "classroom_conf_frequency_above": + return ec.fieldContext_Classroom_classroom_conf_frequency_above(ctx, field) + case "classroom_conf_frequency_on": + return ec.fieldContext_Classroom_classroom_conf_frequency_on(ctx, field) + case "classroom_conf_frequency_below": + return ec.fieldContext_Classroom_classroom_conf_frequency_below(ctx, field) + case "classroom_conf_frequency_far_below": + return ec.fieldContext_Classroom_classroom_conf_frequency_far_below(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Classroom", 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_Mutation_createClassroom_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createStudent(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createStudent(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.Mutation().CreateStudent(rctx, fc.Args["input"].(model.NewStudent)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.Student) + fc.Result = res + return ec.marshalNStudent2ᚖremoᚋbackendᚋgraphᚋmodelᚐStudent(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createStudent(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + 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_Student_id(ctx, field) + case "studentId": + return ec.fieldContext_Student_studentId(ctx, field) + case "studentAppId": + return ec.fieldContext_Student_studentAppId(ctx, field) + case "studentCalpadsSsid": + return ec.fieldContext_Student_studentCalpadsSsid(ctx, field) + case "studentLoginId": + return ec.fieldContext_Student_studentLoginId(ctx, field) + case "firstName": + return ec.fieldContext_Student_firstName(ctx, field) + case "middleName": + return ec.fieldContext_Student_middleName(ctx, field) + case "lastName": + return ec.fieldContext_Student_lastName(ctx, field) + case "dateCreated": + return ec.fieldContext_Student_dateCreated(ctx, field) + case "dateUpdated": + return ec.fieldContext_Student_dateUpdated(ctx, field) + case "preferredName": + return ec.fieldContext_Student_preferredName(ctx, field) + case "gender": + return ec.fieldContext_Student_gender(ctx, field) + case "pronoun": + return ec.fieldContext_Student_pronoun(ctx, field) + case "birthDate": + return ec.fieldContext_Student_birthDate(ctx, field) + case "gradeLevel": + return ec.fieldContext_Student_gradeLevel(ctx, field) + case "gradeMovement": + return ec.fieldContext_Student_gradeMovement(ctx, field) + case "guidedReadingLevel": + return ec.fieldContext_Student_guidedReadingLevel(ctx, field) + case "rtiSrvType": + return ec.fieldContext_Student_rtiSrvType(ctx, field) + case "studentServices": + return ec.fieldContext_Student_studentServices(ctx, field) + case "rtiServices": + return ec.fieldContext_Student_rtiServices(ctx, field) + case "specializedCourses": + return ec.fieldContext_Student_specializedCourses(ctx, field) + case "gradeLevelStatus": + return ec.fieldContext_Student_gradeLevelStatus(ctx, field) + case "lexileLevelMin": + return ec.fieldContext_Student_lexileLevelMin(ctx, field) + case "lexileLevelMax": + return ec.fieldContext_Student_lexileLevelMax(ctx, field) + case "type": + return ec.fieldContext_Student_type(ctx, field) + case "weakness": + return ec.fieldContext_Student_weakness(ctx, field) + case "readerType": + return ec.fieldContext_Student_readerType(ctx, field) + case "readingStage": + return ec.fieldContext_Student_readingStage(ctx, field) + case "ethnicity": + return ec.fieldContext_Student_ethnicity(ctx, field) + case "avatar": + return ec.fieldContext_Student_avatar(ctx, field) + case "backupAvatar": + return ec.fieldContext_Student_backupAvatar(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Student", 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_Mutation_createStudent_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Mutation_createNewReadingRateResults(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Mutation_createNewReadingRateResults(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.Mutation().CreateNewReadingRateResults(rctx, fc.Args["input"].(model.NewReadingRateResults)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*model.ReadingRateResult) + fc.Result = res + return ec.marshalNReadingRateResult2ᚖremoᚋbackendᚋgraphᚋmodelᚐReadingRateResult(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Mutation_createNewReadingRateResults(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Mutation", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "reading_rate_results_id": + return ec.fieldContext_ReadingRateResult_reading_rate_results_id(ctx, field) + case "user_id": + return ec.fieldContext_ReadingRateResult_user_id(ctx, field) + case "book_id": + return ec.fieldContext_ReadingRateResult_book_id(ctx, field) + case "user_book_id": + return ec.fieldContext_ReadingRateResult_user_book_id(ctx, field) + case "date": + return ec.fieldContext_ReadingRateResult_date(ctx, field) + case "reading_location": + return ec.fieldContext_ReadingRateResult_reading_location(ctx, field) + case "type_of_reading": + return ec.fieldContext_ReadingRateResult_type_of_reading(ctx, field) + case "reading_setting": + return ec.fieldContext_ReadingRateResult_reading_setting(ctx, field) + case "reading_type_details": + return ec.fieldContext_ReadingRateResult_reading_type_details(ctx, field) + case "start_time": + return ec.fieldContext_ReadingRateResult_start_time(ctx, field) + case "end_time": + return ec.fieldContext_ReadingRateResult_end_time(ctx, field) + case "total_time": + return ec.fieldContext_ReadingRateResult_total_time(ctx, field) + case "start_page": + return ec.fieldContext_ReadingRateResult_start_page(ctx, field) + case "end_page": + return ec.fieldContext_ReadingRateResult_end_page(ctx, field) + case "total_pages": + return ec.fieldContext_ReadingRateResult_total_pages(ctx, field) + case "word_per_page": + return ec.fieldContext_ReadingRateResult_word_per_page(ctx, field) + case "types_of_reading": + return ec.fieldContext_ReadingRateResult_types_of_reading(ctx, field) + case "section_rating": + return ec.fieldContext_ReadingRateResult_section_rating(ctx, field) + case "check_in": + return ec.fieldContext_ReadingRateResult_check_in(ctx, field) + case "reader_request": + return ec.fieldContext_ReadingRateResult_reader_request(ctx, field) + case "reader_request_almost_finished": + return ec.fieldContext_ReadingRateResult_reader_request_almost_finished(ctx, field) + case "reader_continuum": + return ec.fieldContext_ReadingRateResult_reader_continuum(ctx, field) + case "words_per_page": + return ec.fieldContext_ReadingRateResult_words_per_page(ctx, field) + case "observational_notes": + return ec.fieldContext_ReadingRateResult_observational_notes(ctx, field) + case "share_feedback": + return ec.fieldContext_ReadingRateResult_share_feedback(ctx, field) + case "reader_response": + return ec.fieldContext_ReadingRateResult_reader_response(ctx, field) + case "reading_response_pages": + return ec.fieldContext_ReadingRateResult_reading_response_pages(ctx, field) + case "reading_response_type": + return ec.fieldContext_ReadingRateResult_reading_response_type(ctx, field) + case "reading_response_subtype": + return ec.fieldContext_ReadingRateResult_reading_response_subtype(ctx, field) + case "grade_level": + return ec.fieldContext_ReadingRateResult_grade_level(ctx, field) + case "grade_level_status": + return ec.fieldContext_ReadingRateResult_grade_level_status(ctx, field) + case "teacher_id": + return ec.fieldContext_ReadingRateResult_teacher_id(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type ReadingRateResult", 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_Mutation_createNewReadingRateResults_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_getBookByISBN(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getBookByISBN(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().GetBookByIsbn(rctx, fc.Args["isbn"].(int)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.Book) + fc.Result = res + return ec.marshalOBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getBookByISBN(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_Book_id(ctx, field) + case "story_id": + return ec.fieldContext_Book_story_id(ctx, field) + case "author": + return ec.fieldContext_Book_author(ctx, field) + case "cover_image": + return ec.fieldContext_Book_cover_image(ctx, field) + case "date_created": + return ec.fieldContext_Book_date_created(ctx, field) + case "date_updated": + return ec.fieldContext_Book_date_updated(ctx, field) + case "default_user_id": + return ec.fieldContext_Book_default_user_id(ctx, field) + case "foreword": + return ec.fieldContext_Book_foreword(ctx, field) + case "editor": + return ec.fieldContext_Book_editor(ctx, field) + case "illustrator": + return ec.fieldContext_Book_illustrator(ctx, field) + case "isbn_10": + return ec.fieldContext_Book_isbn_10(ctx, field) + case "isbn_13": + return ec.fieldContext_Book_isbn_13(ctx, field) + case "num_pages": + return ec.fieldContext_Book_num_pages(ctx, field) + case "pub_date": + return ec.fieldContext_Book_pub_date(ctx, field) + case "copyright_date": + return ec.fieldContext_Book_copyright_date(ctx, field) + case "edition": + return ec.fieldContext_Book_edition(ctx, field) + case "synopsis": + return ec.fieldContext_Book_synopsis(ctx, field) + case "title": + return ec.fieldContext_Book_title(ctx, field) + case "word_count": + return ec.fieldContext_Book_word_count(ctx, field) + case "sub_title": + return ec.fieldContext_Book_sub_title(ctx, field) + case "asin": + return ec.fieldContext_Book_asin(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Book", 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_getBookByISBN_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return + } + return fc, nil +} + +func (ec *executionContext) _Query_teachers(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_teachers(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().Teachers(rctx) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]*model.Teacher) + fc.Result = res + return ec.marshalNTeacher2ᚕᚖremoᚋbackendᚋgraphᚋmodelᚐTeacherᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_teachers(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 "teacher_ID": + return ec.fieldContext_Teacher_teacher_ID(ctx, field) + case "Teacher_login_id": + return ec.fieldContext_Teacher_Teacher_login_id(ctx, field) + case "Teacher_title": + return ec.fieldContext_Teacher_Teacher_title(ctx, field) + case "Teacher_first_name": + return ec.fieldContext_Teacher_Teacher_first_name(ctx, field) + case "Teacher_middle_name": + return ec.fieldContext_Teacher_Teacher_middle_name(ctx, field) + case "Teacher_last_name": + return ec.fieldContext_Teacher_Teacher_last_name(ctx, field) + case "Teacher_suffix": + return ec.fieldContext_Teacher_Teacher_suffix(ctx, field) + case "Teacher_date_of_birth": + return ec.fieldContext_Teacher_Teacher_date_of_birth(ctx, field) + case "Teacher_date_started_teaching": + return ec.fieldContext_Teacher_Teacher_date_started_teaching(ctx, field) + case "Degree_level_id": + return ec.fieldContext_Teacher_Degree_level_id(ctx, field) + case "Is_certified": + return ec.fieldContext_Teacher_Is_certified(ctx, field) + case "Certification_id": + return ec.fieldContext_Teacher_Certification_id(ctx, field) + case "Certification_start": + return ec.fieldContext_Teacher_Certification_start(ctx, field) + case "Certification_end": + return ec.fieldContext_Teacher_Certification_end(ctx, field) + case "Teacher_avatar": + return ec.fieldContext_Teacher_Teacher_avatar(ctx, field) + case "Teacher_backup_avater": + return ec.fieldContext_Teacher_Teacher_backup_avater(ctx, field) + case "Teacher_subscription_type": + return ec.fieldContext_Teacher_Teacher_subscription_type(ctx, field) + case "Teacher_code_name": + return ec.fieldContext_Teacher_Teacher_code_name(ctx, field) + case "Teacher_display_name": + return ec.fieldContext_Teacher_Teacher_display_name(ctx, field) + case "Quarantined_books": + return ec.fieldContext_Teacher_Quarantined_books(ctx, field) + case "Teacher_backup_email": + return ec.fieldContext_Teacher_Teacher_backup_email(ctx, field) + case "Teacher_gender": + return ec.fieldContext_Teacher_Teacher_gender(ctx, field) + case "Teacher_pronoun": + return ec.fieldContext_Teacher_Teacher_pronoun(ctx, field) + case "Teacher_position": + return ec.fieldContext_Teacher_Teacher_position(ctx, field) + case "Teacher_grade_band": + return ec.fieldContext_Teacher_Teacher_grade_band(ctx, field) + case "Teacher_subjects": + return ec.fieldContext_Teacher_Teacher_subjects(ctx, field) + case "Teacher_provided_services": + return ec.fieldContext_Teacher_Teacher_provided_services(ctx, field) + case "Teacher_specialized_courses": + return ec.fieldContext_Teacher_Teacher_specialized_courses(ctx, field) + case "Teacher_state_id": + return ec.fieldContext_Teacher_Teacher_state_id(ctx, field) + case "Teacher_district": + return ec.fieldContext_Teacher_Teacher_district(ctx, field) + case "Teacher_school": + return ec.fieldContext_Teacher_Teacher_school(ctx, field) + case "Teacher_cell_phone": + return ec.fieldContext_Teacher_Teacher_cell_phone(ctx, field) + case "Teacher_texts_enabled": + return ec.fieldContext_Teacher_Teacher_texts_enabled(ctx, field) + case "Active": + return ec.fieldContext_Teacher_Active(ctx, field) + case "Teacher_date_created": + return ec.fieldContext_Teacher_Teacher_date_created(ctx, field) + case "Teacher_date_updated": + return ec.fieldContext_Teacher_Teacher_date_updated(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Teacher", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Query_getUserByID(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_getUserByID(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().GetUserByID(rctx, fc.Args["id"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*model.User) + fc.Result = res + return ec.marshalOUser2ᚖremoᚋbackendᚋgraphᚋmodelᚐUser(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_getUserByID(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_User_id(ctx, field) + case "student_id": + return ec.fieldContext_User_student_id(ctx, field) + case "student_app_id": + return ec.fieldContext_User_student_app_id(ctx, field) + case "student_calpads_ssid": + return ec.fieldContext_User_student_calpads_ssid(ctx, field) + case "student_login_id": + return ec.fieldContext_User_student_login_id(ctx, field) + case "first_name": + return ec.fieldContext_User_first_name(ctx, field) + case "middle_name": + return ec.fieldContext_User_middle_name(ctx, field) + case "last_name": + return ec.fieldContext_User_last_name(ctx, field) + case "date_created": + return ec.fieldContext_User_date_created(ctx, field) + case "date_updated": + return ec.fieldContext_User_date_updated(ctx, field) + case "preferred_name": + return ec.fieldContext_User_preferred_name(ctx, field) + case "gender": + return ec.fieldContext_User_gender(ctx, field) + case "pronoun": + return ec.fieldContext_User_pronoun(ctx, field) + case "birth_date": + return ec.fieldContext_User_birth_date(ctx, field) + case "grade_level": + return ec.fieldContext_User_grade_level(ctx, field) + case "grade_movement": + return ec.fieldContext_User_grade_movement(ctx, field) + case "guided_reading_level": + return ec.fieldContext_User_guided_reading_level(ctx, field) + case "rti_srv_type": + return ec.fieldContext_User_rti_srv_type(ctx, field) + case "student_services": + return ec.fieldContext_User_student_services(ctx, field) + case "rti_services": + return ec.fieldContext_User_rti_services(ctx, field) + case "specialized_courses": + return ec.fieldContext_User_specialized_courses(ctx, field) + case "grade_level_status": + return ec.fieldContext_User_grade_level_status(ctx, field) + case "lexile_level_min": + return ec.fieldContext_User_lexile_level_min(ctx, field) + case "lexile_level_max": + return ec.fieldContext_User_lexile_level_max(ctx, field) + case "type": + return ec.fieldContext_User_type(ctx, field) + case "weakness": + return ec.fieldContext_User_weakness(ctx, field) + case "reader_type": + return ec.fieldContext_User_reader_type(ctx, field) + case "reading_stage": + return ec.fieldContext_User_reading_stage(ctx, field) + case "ethnicity": + return ec.fieldContext_User_ethnicity(ctx, field) + case "avatar": + return ec.fieldContext_User_avatar(ctx, field) + case "backup_avatar": + return ec.fieldContext_User_backup_avatar(ctx, field) + case "self_assessment": + return ec.fieldContext_User_self_assessment(ctx, field) + case "reader_non_reader": + return ec.fieldContext_User_reader_non_reader(ctx, field) + case "read_goal": + return ec.fieldContext_User_read_goal(ctx, field) + case "type_of_reading": + return ec.fieldContext_User_type_of_reading(ctx, field) + case "book_finish": + return ec.fieldContext_User_book_finish(ctx, field) + case "read_speed": + return ec.fieldContext_User_read_speed(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type User", 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_getUserByID_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) + } + 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) + } + 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) _ReadingRateResult_reading_rate_results_id(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_rate_results_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.Reading_rate_results_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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_rate_results_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_user_id(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_user_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.User_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_user_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_book_id(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_book_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.Book_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_book_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_user_book_id(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_user_book_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.User_book_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_user_book_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_date(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_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 ec.resolvers.ReadingRateResult().Date(rctx, obj) + }) + 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_ReadingRateResult_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _ReadingRateResult_reading_location(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_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.Reading_location, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_location(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_type_of_reading(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_type_of_reading(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_of_reading, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_type_of_reading(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reading_setting(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_setting(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.Reading_setting, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_setting(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reading_type_details(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_type_details(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.Reading_type_details, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_type_details(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_start_time(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_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 ec.resolvers.ReadingRateResult().StartTime(rctx, obj) + }) + 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_ReadingRateResult_start_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _ReadingRateResult_end_time(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_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 ec.resolvers.ReadingRateResult().EndTime(rctx, obj) + }) + 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_ReadingRateResult_end_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _ReadingRateResult_total_time(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_total_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.Total_time, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_total_time(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_start_page(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_start_page(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.Start_page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_start_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_end_page(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_end_page(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.End_page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_end_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_total_pages(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_total_pages(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.Total_pages, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_total_pages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_word_per_page(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_word_per_page(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.Word_per_page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_word_per_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_types_of_reading(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_types_of_reading(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_of_reading, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_types_of_reading(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_section_rating(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_section_rating(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.Section_rating, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_section_rating(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_check_in(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_check_in(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.Check_in, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_check_in(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reader_request(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reader_request(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.Reader_request, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reader_request(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reader_request_almost_finished(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reader_request_almost_finished(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.Reader_request_almost_finished, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reader_request_almost_finished(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reader_continuum(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reader_continuum(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.Reader_continuum, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reader_continuum(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_words_per_page(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_words_per_page(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.Words_per_page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_words_per_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_observational_notes(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_observational_notes(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.Observational_notes, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_observational_notes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_share_feedback(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_share_feedback(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.Share_feedback, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_share_feedback(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reader_response(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reader_response(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.Reader_response, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reader_response(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reading_response_pages(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_response_pages(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.Reading_response_pages, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_response_pages(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reading_response_type(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_response_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.Reading_response_type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_response_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_reading_response_subtype(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_reading_response_subtype(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.Reading_response_subtype, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_reading_response_subtype(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_grade_level(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_grade_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.Grade_level, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_grade_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_grade_level_status(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_grade_level_status(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.Grade_level_status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_grade_level_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _ReadingRateResult_teacher_id(ctx context.Context, field graphql.CollectedField, obj *model.ReadingRateResult) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_ReadingRateResult_teacher_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.Teacher_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_ReadingRateResult_teacher_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "ReadingRateResult", + 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) _Student_id(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_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.(int) + fc.Result = res + return ec.marshalNID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_studentId(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_studentId(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.Student_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_Student_studentId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_studentAppId(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_studentAppId(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.Student_app_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_Student_studentAppId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_studentCalpadsSsid(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_studentCalpadsSsid(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.Student_calpads_ssid, 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.marshalOID2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_studentCalpadsSsid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_studentLoginId(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_studentLoginId(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.Student_login_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_studentLoginId(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_firstName(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_firstName(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.First_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_Student_firstName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_middleName(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_middleName(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.Middle_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_Student_middleName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_lastName(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_lastName(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.Last_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_Student_lastName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_dateCreated(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_dateCreated(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.Student().DateCreated(rctx, obj) + }) + 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_Student_dateCreated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Student_dateUpdated(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_dateUpdated(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.Student().DateUpdated(rctx, obj) + }) + 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_Student_dateUpdated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Student_preferredName(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_preferredName(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.Preferred_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_preferredName(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_gender(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_gender(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.Gender, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_gender(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_pronoun(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_pronoun(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.Pronoun, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_pronoun(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_birthDate(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_birthDate(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.Birth_date, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_birthDate(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_gradeLevel(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_gradeLevel(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.Grade_level, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_gradeLevel(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_gradeMovement(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_gradeMovement(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.Grade_movement, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_gradeMovement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_guidedReadingLevel(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_guidedReadingLevel(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.Guided_reading_level, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_guidedReadingLevel(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_rtiSrvType(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_rtiSrvType(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.Student().RtiSrvType(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_rtiSrvType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Student_studentServices(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_studentServices(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.Student_services, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_studentServices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_rtiServices(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_rtiServices(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.Rti_services, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_rtiServices(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_specializedCourses(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_specializedCourses(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.Specialized_courses, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_specializedCourses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_gradeLevelStatus(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_gradeLevelStatus(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.Grade_level_status, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_gradeLevelStatus(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_lexileLevelMin(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_lexileLevelMin(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.Lexile_level_min, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_lexileLevelMin(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_lexileLevelMax(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_lexileLevelMax(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.Lexile_level_max, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_lexileLevelMax(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_type(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_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 { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_weakness(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_weakness(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.Weakness, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_weakness(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_readerType(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_readerType(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.Reader_type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_readerType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_readingStage(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_readingStage(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.Reading_stage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_readingStage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_ethnicity(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_ethnicity(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.Ethnicity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_ethnicity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_avatar(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_avatar(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.Avatar, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_avatar(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Student_backupAvatar(ctx context.Context, field graphql.CollectedField, obj *model.Student) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Student_backupAvatar(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.Backup_avatar, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Student_backupAvatar(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Student", + 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) _Teacher_teacher_ID(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_teacher_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.Teacher_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.(int) + fc.Result = res + return ec.marshalNID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_teacher_ID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_login_id(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_login_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.Teacher_login_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_login_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_title(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_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.Teacher_title, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_title(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_first_name(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_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.Teacher_first_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_Teacher_Teacher_first_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_middle_name(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_middle_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.Teacher_middle_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_middle_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_last_name(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_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.Teacher_last_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_Teacher_Teacher_last_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_suffix(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_suffix(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.Teacher_suffix, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_suffix(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_date_of_birth(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_date_of_birth(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.Teacher().TeacherDateOfBirth(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOdate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_date_of_birth(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_Teacher_date_started_teaching(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_date_started_teaching(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.Teacher_date_started_teaching, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_date_started_teaching(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Degree_level_id(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Degree_level_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.Degree_level_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Degree_level_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Is_certified(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Is_certified(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.Is_certified, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Is_certified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Certification_id(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Certification_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.Certification_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Certification_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Certification_start(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Certification_start(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.Certification_start, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Certification_start(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Certification_end(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Certification_end(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.Certification_end, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Certification_end(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_avatar(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_avatar(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.Teacher_avatar, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_avatar(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_backup_avater(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_backup_avater(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.Teacher_backup_avater, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_backup_avater(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_subscription_type(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_subscription_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.Teacher_subscription_type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_subscription_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_code_name(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_code_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.Teacher_code_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_code_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_display_name(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_display_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.Teacher_display_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_display_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Quarantined_books(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Quarantined_books(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.Quarantined_books, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Quarantined_books(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_backup_email(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_backup_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.Teacher_backup_email, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_backup_email(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_gender(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_gender(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.Teacher_gender, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_gender(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_pronoun(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_pronoun(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.Teacher_pronoun, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_pronoun(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_position(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_position(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.Teacher_position, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_position(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_grade_band(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_grade_band(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.Teacher_grade_band, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_grade_band(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_subjects(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_subjects(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.Teacher_subjects, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_subjects(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_provided_services(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_provided_services(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.Teacher_provided_services, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_provided_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_specialized_courses(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_specialized_courses(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.Teacher_specialized_courses, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_specialized_courses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_state_id(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_state_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.Teacher_state_id, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_state_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_district(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_district(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.Teacher_district, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_district(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_school(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_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.Teacher_school, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_school(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_cell_phone(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_cell_phone(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.Teacher_cell_phone, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_cell_phone(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Teacher_texts_enabled(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_texts_enabled(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.Teacher_texts_enabled, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_texts_enabled(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + 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) _Teacher_Active(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Active(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.Teacher().Active(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.(int) + fc.Result = res + return ec.marshalNInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Active(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _Teacher_Teacher_date_created(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_date_created(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.Teacher().TeacherDateCreated(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.(string) + fc.Result = res + return ec.marshalNdate2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_date_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Teacher_Teacher_date_updated(ctx context.Context, field graphql.CollectedField, obj *model.Teacher) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Teacher_Teacher_date_updated(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.Teacher().TeacherDateUpdated(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOdate2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Teacher_Teacher_date_updated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Teacher", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type date does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_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_User_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_student_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_student_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.StudentID, 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_User_student_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_student_app_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_student_app_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.StudentAppID, 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_User_student_app_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_student_calpads_ssid(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_student_calpads_ssid(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.StudentCalpadsSsid, 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_User_student_calpads_ssid(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_student_login_id(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_student_login_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.StudentLoginID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_student_login_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_first_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_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_User_first_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_middle_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_middle_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.MiddleName, 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_User_middle_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_last_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_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_User_last_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_date_created(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_date_created(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.DateCreated, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_date_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_date_updated(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_date_updated(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.DateUpdated, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_date_updated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_preferred_name(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_preferred_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.PreferredName, 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_User_preferred_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_gender(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_gender(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.Gender, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_gender(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_pronoun(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_pronoun(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.Pronoun, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_pronoun(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_birth_date(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_birth_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.BirthDate, 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_User_birth_date(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_grade_level(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_grade_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.GradeLevel, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_grade_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_grade_movement(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_grade_movement(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.GradeMovement, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_grade_movement(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_guided_reading_level(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_guided_reading_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.GuidedReadingLevel, 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_User_guided_reading_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_rti_srv_type(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_rti_srv_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.RtiSrvType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_rti_srv_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_student_services(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_student_services(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.StudentServices, 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_User_student_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_rti_services(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_rti_services(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.RtiServices, 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_User_rti_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_specialized_courses(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_specialized_courses(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.SpecializedCourses, 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_User_specialized_courses(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_grade_level_status(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_grade_level_status(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.GradeLevelStatus, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_grade_level_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_lexile_level_min(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_lexile_level_min(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.LexileLevelMin, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_lexile_level_min(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_lexile_level_max(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_lexile_level_max(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.LexileLevelMax, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_lexile_level_max(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_type(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_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 { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_weakness(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_weakness(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.Weakness, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_weakness(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_reader_type(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_reader_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.ReaderType, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_reader_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_reading_stage(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_reading_stage(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.ReadingStage, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_reading_stage(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_ethnicity(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_ethnicity(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.Ethnicity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_ethnicity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_avatar(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_avatar(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.Avatar, 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_User_avatar(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_backup_avatar(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_backup_avatar(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.BackupAvatar, 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_User_backup_avatar(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_self_assessment(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_self_assessment(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.SelfAssessment, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_self_assessment(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_reader_non_reader(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_reader_non_reader(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.ReaderNonReader, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_reader_non_reader(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_read_goal(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_read_goal(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.ReadGoal, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_read_goal(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_type_of_reading(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_type_of_reading(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.TypeOfReading, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_type_of_reading(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_book_finish(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_book_finish(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.BookFinish, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_book_finish(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _User_read_speed(ctx context.Context, field graphql.CollectedField, obj *model.User) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_User_read_speed(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.ReadSpeed, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_User_read_speed(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "User", + 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) _UserBook_id(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_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.(int) + fc.Result = res + return ec.marshalNID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_book_id(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_book_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.Book_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.(int) + fc.Result = res + return ec.marshalNID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_book_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_book_type(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_book_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.Book_type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_book_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_checkout_status(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_checkout_status(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.Checkout_status, 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_UserBook_checkout_status(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_condition(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_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 { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_condition(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_cover_image(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_cover_image(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.Cover_image, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_cover_image(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_date_created(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_date_created(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.Date_created, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_date_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserBook_date_updated(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_date_updated(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.Date_updated, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(time.Time) + fc.Result = res + return ec.marshalOTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_date_updated(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type Time does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _UserBook_format(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_format(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.Format, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_format(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_guided_reading_level(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_guided_reading_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.Guided_reading_level, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_guided_reading_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_lexile_level(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_lexile_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.Lexile_level, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_lexile_level(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_location(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_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 { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_location(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_mentor_text(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_mentor_text(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.Mentor_text, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_mentor_text(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_multiple_pov(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_multiple_pov(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.Multiple_pov, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_multiple_pov(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_price(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_price(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.Price, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalOFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_price(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_qty_label(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_qty_label(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.UserBook().QtyLabel(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*int) + fc.Result = res + return ec.marshalOInt2ᚖint(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_qty_label(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + Field: field, + IsMethod: true, + IsResolver: true, + 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) _UserBook_series(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_series(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.Series, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_series(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_series_name(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_series_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.Series_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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_series_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_series_pos(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_series_pos(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.Series_pos, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_series_pos(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_tags(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_tags(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.Tags, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_tags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_teacher_notes(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_teacher_notes(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.Teacher_notes, 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.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_teacher_notes(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_teacher_read(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_teacher_read(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.Teacher_read, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_teacher_read(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_text_complexity(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_text_complexity(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.Text_complexity, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_text_complexity(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_unpaged(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_unpaged(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.Unpaged, 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_UserBook_unpaged(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_unreliable_narrative(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_unreliable_narrative(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.Unreliable_narrative, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_unreliable_narrative(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_user_id(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_user_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.User_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_user_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_entered_user_id(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_entered_user_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.Entered_user_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOID2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_entered_user_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_want_for_classroom(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_want_for_classroom(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.Want_for_classroom, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_want_for_classroom(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_own_this_copy(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_own_this_copy(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.Own_this_copy, 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_UserBook_own_this_copy(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_want_to_discard(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_want_to_discard(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.Want_to_discard, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_want_to_discard(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_word_count(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_word_count(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.Word_count, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_word_count(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_words_per_page(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_words_per_page(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.Words_per_page, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_words_per_page(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) _UserBook_current_user_id(ctx context.Context, field graphql.CollectedField, obj *model.UserBook) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_UserBook_current_user_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.Current_user_id, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int) + fc.Result = res + return ec.marshalOInt2int(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_UserBook_current_user_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "UserBook", + 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) ___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{ @@ -2483,303 +13607,1689 @@ func (ec *executionContext) fieldContext___Type_possibleTypes(ctx context.Contex 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 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 ***************************** + +func (ec *executionContext) unmarshalInputBookInput(ctx context.Context, obj interface{}) (model.BookInput, error) { + var it model.BookInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id", "story_id", "author", "cover_image", "date_created", "date_updated", "default_user_id", "foreword", "editor", "illustrator", "isbn_10", "isbn_13", "num_pages", "pub_date", "copyright_date", "edition", "synopsis", "title", "word_count", "sub_title", "asin"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "story_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("story_id")) + it.StoryID, err = ec.unmarshalOID2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "author": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("author")) + it.Author, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "cover_image": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("cover_image")) + it.CoverImage, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "date_created": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("date_created")) + it.DateCreated, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + case "date_updated": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("date_updated")) + it.DateUpdated, err = ec.unmarshalOTime2ᚖtimeᚐTime(ctx, v) + if err != nil { + return it, err + } + case "default_user_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("default_user_id")) + it.DefaultUserID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "foreword": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("foreword")) + it.Foreword, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "editor": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("editor")) + it.Editor, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "illustrator": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("illustrator")) + it.Illustrator, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "isbn_10": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isbn_10")) + it.Isbn10, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "isbn_13": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("isbn_13")) + it.Isbn13, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "num_pages": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("num_pages")) + it.NumPages, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "pub_date": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pub_date")) + it.PubDate, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "copyright_date": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("copyright_date")) + it.CopyrightDate, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "edition": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("edition")) + it.Edition, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "synopsis": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("synopsis")) + it.Synopsis, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "title": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) + it.Title, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "word_count": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("word_count")) + it.WordCount, err = ec.unmarshalOInt2ᚖint(ctx, v) + if err != nil { + return it, err + } + case "sub_title": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sub_title")) + it.SubTitle, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "asin": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("asin")) + it.Asin, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } } - return fc, nil + + return it, nil +} + +func (ec *executionContext) unmarshalInputNewClassroom(ctx context.Context, obj interface{}) (model.NewClassroom, error) { + var it model.NewClassroom + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"classroom_id", "Classroom_co_teacher_id", "classroom_status_id"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "classroom_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("classroom_id")) + it.ClassroomID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "Classroom_co_teacher_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Classroom_co_teacher_id")) + it.ClassroomCoTeacherID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "classroom_status_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("classroom_status_id")) + it.ClassroomStatusID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNewStudent(ctx context.Context, obj interface{}) (model.NewStudent, error) { + var it model.NewStudent + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id", "Student_id", "student_app_id", "First_name", "Middle_name", "last_name"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "Student_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Student_id")) + it.StudentID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "student_app_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("student_app_id")) + it.StudentAppID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "First_name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("First_name")) + it.FirstName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "Middle_name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Middle_name")) + it.MiddleName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "last_name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("last_name")) + it.LastName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputNewTeacher(ctx context.Context, obj interface{}) (model.NewTeacher, error) { + var it model.NewTeacher + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"id", "Teacher_first_name", "Teacher_last_name", "Active", "Teacher_date_created", "Teacher_date_updated"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "Teacher_first_name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Teacher_first_name")) + it.TeacherFirstName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "Teacher_last_name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Teacher_last_name")) + it.TeacherLastName, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "Active": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Active")) + it.Active, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + case "Teacher_date_created": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Teacher_date_created")) + it.TeacherDateCreated, err = ec.unmarshalNTime2timeᚐTime(ctx, v) + if err != nil { + return it, err + } + case "Teacher_date_updated": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Teacher_date_updated")) + it.TeacherDateUpdated, err = ec.unmarshalNTime2timeᚐTime(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputnewReadingRateResults(ctx context.Context, obj interface{}) (model.NewReadingRateResults, error) { + var it model.NewReadingRateResults + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + fieldsInOrder := [...]string{"Reading_rate_results_id", "Words_per_page"} + for _, k := range fieldsInOrder { + v, ok := asMap[k] + if !ok { + continue + } + switch k { + case "Reading_rate_results_id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Reading_rate_results_id")) + it.ReadingRateResultsID, err = ec.unmarshalNID2string(ctx, v) + if err != nil { + return it, err + } + case "Words_per_page": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("Words_per_page")) + it.WordsPerPage, err = ec.unmarshalNInt2int(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, 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 { +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var bookImplementors = []string{"Book"} + +func (ec *executionContext) _Book(ctx context.Context, sel ast.SelectionSet, obj *model.Book) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, bookImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Book") + case "id": + + out.Values[i] = ec._Book_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "story_id": + + out.Values[i] = ec._Book_story_id(ctx, field, obj) + + case "author": + + out.Values[i] = ec._Book_author(ctx, field, obj) + + case "cover_image": + + out.Values[i] = ec._Book_cover_image(ctx, field, obj) + + case "date_created": + + out.Values[i] = ec._Book_date_created(ctx, field, obj) + + case "date_updated": + + out.Values[i] = ec._Book_date_updated(ctx, field, obj) + + case "default_user_id": + + out.Values[i] = ec._Book_default_user_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "foreword": + + out.Values[i] = ec._Book_foreword(ctx, field, obj) + + case "editor": + + out.Values[i] = ec._Book_editor(ctx, field, obj) + + case "illustrator": + + out.Values[i] = ec._Book_illustrator(ctx, field, obj) + + case "isbn_10": + + out.Values[i] = ec._Book_isbn_10(ctx, field, obj) + + case "isbn_13": + + out.Values[i] = ec._Book_isbn_13(ctx, field, obj) + + case "num_pages": + + out.Values[i] = ec._Book_num_pages(ctx, field, obj) + + case "pub_date": + + out.Values[i] = ec._Book_pub_date(ctx, field, obj) + + case "copyright_date": + + out.Values[i] = ec._Book_copyright_date(ctx, field, obj) + + case "edition": + + out.Values[i] = ec._Book_edition(ctx, field, obj) + + case "synopsis": + + out.Values[i] = ec._Book_synopsis(ctx, field, obj) + + case "title": + + out.Values[i] = ec._Book_title(ctx, field, obj) + + case "word_count": + + out.Values[i] = ec._Book_word_count(ctx, field, obj) + + case "sub_title": + + out.Values[i] = ec._Book_sub_title(ctx, field, obj) + + case "asin": + + out.Values[i] = ec._Book_asin(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { 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 + return out +} + +var classroomImplementors = []string{"Classroom"} + +func (ec *executionContext) _Classroom(ctx context.Context, sel ast.SelectionSet, obj *model.Classroom) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, classroomImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Classroom") + case "classroomId": + + out.Values[i] = ec._Classroom_classroomId(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "classroom_school_id": + + out.Values[i] = ec._Classroom_classroom_school_id(ctx, field, obj) + + case "classroom_school_year": + 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._Classroom_classroom_school_year(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_start_date": + 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._Classroom_classroom_start_date(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_end_date": + 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._Classroom_classroom_end_date(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_name": + 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._Classroom_classroom_name(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_subject": + 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._Classroom_classroom_subject(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_display_name": + 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._Classroom_classroom_display_name(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_avg_length": + 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._Classroom_classroom_avg_length(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_avg_days": + + out.Values[i] = ec._Classroom_classroom_avg_days(ctx, field, obj) + + case "classroom_grade_level_type": + + out.Values[i] = ec._Classroom_classroom_grade_level_type(ctx, field, obj) + + case "classroom_grade_level": + + out.Values[i] = ec._Classroom_classroom_grade_level(ctx, field, obj) + + case "classroom_co_teacher_id": + + out.Values[i] = ec._Classroom_classroom_co_teacher_id(ctx, field, obj) + + case "classroom_teacher_idV1": + + out.Values[i] = ec._Classroom_classroom_teacher_idV1(ctx, field, obj) + + case "classroom_num_students": + + out.Values[i] = ec._Classroom_classroom_num_students(ctx, field, obj) + + case "classroom_num_seats": + + out.Values[i] = ec._Classroom_classroom_num_seats(ctx, field, obj) + + case "classroom_status_id": + 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._Classroom_classroom_status_id(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "classroom_conf_frequency_above": + + out.Values[i] = ec._Classroom_classroom_conf_frequency_above(ctx, field, obj) + + case "classroom_conf_frequency_on": + + out.Values[i] = ec._Classroom_classroom_conf_frequency_on(ctx, field, obj) + + case "classroom_conf_frequency_below": + + out.Values[i] = ec._Classroom_classroom_conf_frequency_below(ctx, field, obj) + + case "classroom_conf_frequency_far_below": + + out.Values[i] = ec._Classroom_classroom_conf_frequency_far_below(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -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) +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + 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("Mutation") + case "createBook": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createBook(ctx, field) + }) + + case "updateBook": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_updateBook(ctx, field) + }) + + case "createTeacher": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createTeacher(ctx, field) + }) + + case "createClassroom": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createClassroom(ctx, field) + }) + + case "createStudent": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createStudent(ctx, field) + }) + + case "createNewReadingRateResults": + + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Mutation_createNewReadingRateResults(ctx, field) + }) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 + out.Dispatch() + return out } -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 +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", }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null + + out := graphql.NewFieldSet(fields) + 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 "getBookByISBN": + 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_getBookByISBN(ctx, field) + 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 "teachers": + 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_teachers(ctx, field) + 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 "getUserByID": + 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_getUserByID(ctx, field) + 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)) + } } - res := resTmp.([]introspection.InputValue) - fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + out.Dispatch() + return out } -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 -} +var readingRateResultImplementors = []string{"ReadingRateResult"} + +func (ec *executionContext) _ReadingRateResult(ctx context.Context, sel ast.SelectionSet, obj *model.ReadingRateResult) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, readingRateResultImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ReadingRateResult") + case "reading_rate_results_id": + + out.Values[i] = ec._ReadingRateResult_reading_rate_results_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "user_id": + + out.Values[i] = ec._ReadingRateResult_user_id(ctx, field, obj) + + case "book_id": + + out.Values[i] = ec._ReadingRateResult_book_id(ctx, field, obj) + + case "user_book_id": + + out.Values[i] = ec._ReadingRateResult_user_book_id(ctx, field, obj) + + case "date": + 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._ReadingRateResult_date(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "reading_location": + + out.Values[i] = ec._ReadingRateResult_reading_location(ctx, field, obj) + + case "type_of_reading": + + out.Values[i] = ec._ReadingRateResult_type_of_reading(ctx, field, obj) + + case "reading_setting": + + out.Values[i] = ec._ReadingRateResult_reading_setting(ctx, field, obj) + + case "reading_type_details": + + out.Values[i] = ec._ReadingRateResult_reading_type_details(ctx, field, obj) + + case "start_time": + 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._ReadingRateResult_start_time(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "end_time": + 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._ReadingRateResult_end_time(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "total_time": + + out.Values[i] = ec._ReadingRateResult_total_time(ctx, field, obj) + + case "start_page": + + out.Values[i] = ec._ReadingRateResult_start_page(ctx, field, obj) + + case "end_page": + + out.Values[i] = ec._ReadingRateResult_end_page(ctx, field, obj) + + case "total_pages": + + out.Values[i] = ec._ReadingRateResult_total_pages(ctx, field, obj) + + case "word_per_page": + + out.Values[i] = ec._ReadingRateResult_word_per_page(ctx, field, obj) + + case "types_of_reading": + + out.Values[i] = ec._ReadingRateResult_types_of_reading(ctx, field, obj) + + case "section_rating": + + out.Values[i] = ec._ReadingRateResult_section_rating(ctx, field, obj) + + case "check_in": + + out.Values[i] = ec._ReadingRateResult_check_in(ctx, field, obj) + + case "reader_request": + + out.Values[i] = ec._ReadingRateResult_reader_request(ctx, field, obj) + + case "reader_request_almost_finished": + + out.Values[i] = ec._ReadingRateResult_reader_request_almost_finished(ctx, field, obj) + + case "reader_continuum": + + out.Values[i] = ec._ReadingRateResult_reader_continuum(ctx, field, obj) + + case "words_per_page": + + out.Values[i] = ec._ReadingRateResult_words_per_page(ctx, field, obj) + + case "observational_notes": + + out.Values[i] = ec._ReadingRateResult_observational_notes(ctx, field, obj) + + case "share_feedback": + + out.Values[i] = ec._ReadingRateResult_share_feedback(ctx, field, obj) + + case "reader_response": + + out.Values[i] = ec._ReadingRateResult_reader_response(ctx, field, obj) + + case "reading_response_pages": + + out.Values[i] = ec._ReadingRateResult_reading_response_pages(ctx, field, obj) + + case "reading_response_type": -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 + out.Values[i] = ec._ReadingRateResult_reading_response_type(ctx, field, obj) + + case "reading_response_subtype": + + out.Values[i] = ec._ReadingRateResult_reading_response_subtype(ctx, field, obj) + + case "grade_level": + + out.Values[i] = ec._ReadingRateResult_grade_level(ctx, field, obj) + + case "grade_level_status": + + out.Values[i] = ec._ReadingRateResult_grade_level_status(ctx, field, obj) + + case "teacher_id": + + out.Values[i] = ec._ReadingRateResult_teacher_id(ctx, field, obj) + + default: + panic("unknown field " + strconv.Quote(field.Name)) } - }() - 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 { + out.Dispatch() + if invalids > 0 { 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) + return out } -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) +var studentImplementors = []string{"Student"} + +func (ec *executionContext) _Student(ctx context.Context, sel ast.SelectionSet, obj *model.Student) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, studentImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Student") + case "id": + + out.Values[i] = ec._Student_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } - return nil, fmt.Errorf("no field named %q was found under type __Type", field.Name) - }, - } - return fc, nil -} + case "studentId": -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) -} + out.Values[i] = ec._Student_studentId(ctx, field, obj) -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 -} + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "studentAppId": -// endregion **************************** field.gotpl ***************************** + out.Values[i] = ec._Student_studentAppId(ctx, field, obj) -// region **************************** input.gotpl ***************************** + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "studentCalpadsSsid": -func (ec *executionContext) unmarshalInputNewBook(ctx context.Context, obj interface{}) (model.NewBook, error) { - var it model.NewBook - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } + out.Values[i] = ec._Student_studentCalpadsSsid(ctx, field, obj) - fieldsInOrder := [...]string{"title", "author", "userId"} - for _, k := range fieldsInOrder { - v, ok := asMap[k] - if !ok { - continue - } - switch k { - case "title": - var err error + case "studentLoginId": + + out.Values[i] = ec._Student_studentLoginId(ctx, field, obj) + + case "firstName": + + out.Values[i] = ec._Student_firstName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "middleName": + + out.Values[i] = ec._Student_middleName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "lastName": + + out.Values[i] = ec._Student_lastName(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "dateCreated": + 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._Student_dateCreated(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "dateUpdated": + 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._Student_dateUpdated(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "preferredName": + + out.Values[i] = ec._Student_preferredName(ctx, field, obj) + + case "gender": + + out.Values[i] = ec._Student_gender(ctx, field, obj) + + case "pronoun": + + out.Values[i] = ec._Student_pronoun(ctx, field, obj) + + case "birthDate": + + out.Values[i] = ec._Student_birthDate(ctx, field, obj) + + case "gradeLevel": + + out.Values[i] = ec._Student_gradeLevel(ctx, field, obj) + + case "gradeMovement": + + out.Values[i] = ec._Student_gradeMovement(ctx, field, obj) + + case "guidedReadingLevel": + + out.Values[i] = ec._Student_guidedReadingLevel(ctx, field, obj) + + case "rtiSrvType": + 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._Student_rtiSrvType(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "studentServices": + + out.Values[i] = ec._Student_studentServices(ctx, field, obj) + + case "rtiServices": + + out.Values[i] = ec._Student_rtiServices(ctx, field, obj) + + case "specializedCourses": + + out.Values[i] = ec._Student_specializedCourses(ctx, field, obj) + + case "gradeLevelStatus": + + out.Values[i] = ec._Student_gradeLevelStatus(ctx, field, obj) + + case "lexileLevelMin": + + out.Values[i] = ec._Student_lexileLevelMin(ctx, field, obj) + + case "lexileLevelMax": + + out.Values[i] = ec._Student_lexileLevelMax(ctx, field, obj) + + case "type": + + out.Values[i] = ec._Student_type(ctx, field, obj) + + case "weakness": + + out.Values[i] = ec._Student_weakness(ctx, field, obj) + + case "readerType": + + out.Values[i] = ec._Student_readerType(ctx, field, obj) + + case "readingStage": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("title")) - it.Title, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "author": - var err error + out.Values[i] = ec._Student_readingStage(ctx, field, obj) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("author")) - it.Author, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "userId": - var err error + case "ethnicity": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("userId")) - it.UserID, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - } - } + out.Values[i] = ec._Student_ethnicity(ctx, field, obj) - return it, nil -} + case "avatar": -// endregion **************************** input.gotpl ***************************** + out.Values[i] = ec._Student_avatar(ctx, field, obj) -// region ************************** interface.gotpl *************************** + case "backupAvatar": -// endregion ************************** interface.gotpl *************************** + out.Values[i] = ec._Student_backupAvatar(ctx, field, obj) -// region **************************** object.gotpl **************************** + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} -var bookImplementors = []string{"Book"} +var teacherImplementors = []string{"Teacher"} -func (ec *executionContext) _Book(ctx context.Context, sel ast.SelectionSet, obj *model.Book) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, bookImplementors) +func (ec *executionContext) _Teacher(ctx context.Context, sel ast.SelectionSet, obj *model.Teacher) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, teacherImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Book") - case "id": + out.Values[i] = graphql.MarshalString("Teacher") + case "teacher_ID": - out.Values[i] = ec._Book_id(ctx, field, obj) + out.Values[i] = ec._Teacher_teacher_ID(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "title": + case "Teacher_login_id": + + out.Values[i] = ec._Teacher_Teacher_login_id(ctx, field, obj) + + case "Teacher_title": + + out.Values[i] = ec._Teacher_Teacher_title(ctx, field, obj) + + case "Teacher_first_name": + + out.Values[i] = ec._Teacher_Teacher_first_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "Teacher_middle_name": + + out.Values[i] = ec._Teacher_Teacher_middle_name(ctx, field, obj) + + case "Teacher_last_name": + + out.Values[i] = ec._Teacher_Teacher_last_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "Teacher_suffix": + + out.Values[i] = ec._Teacher_Teacher_suffix(ctx, field, obj) + + case "Teacher_date_of_birth": + 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._Teacher_Teacher_date_of_birth(ctx, field, obj) + return res + } + + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "Teacher_date_started_teaching": + + out.Values[i] = ec._Teacher_Teacher_date_started_teaching(ctx, field, obj) + + case "Degree_level_id": + + out.Values[i] = ec._Teacher_Degree_level_id(ctx, field, obj) + + case "Is_certified": + + out.Values[i] = ec._Teacher_Is_certified(ctx, field, obj) + + case "Certification_id": + + out.Values[i] = ec._Teacher_Certification_id(ctx, field, obj) + + case "Certification_start": + + out.Values[i] = ec._Teacher_Certification_start(ctx, field, obj) + + case "Certification_end": + + out.Values[i] = ec._Teacher_Certification_end(ctx, field, obj) + + case "Teacher_avatar": + + out.Values[i] = ec._Teacher_Teacher_avatar(ctx, field, obj) + + case "Teacher_backup_avater": + + out.Values[i] = ec._Teacher_Teacher_backup_avater(ctx, field, obj) + + case "Teacher_subscription_type": + + out.Values[i] = ec._Teacher_Teacher_subscription_type(ctx, field, obj) + + case "Teacher_code_name": + + out.Values[i] = ec._Teacher_Teacher_code_name(ctx, field, obj) + + case "Teacher_display_name": + + out.Values[i] = ec._Teacher_Teacher_display_name(ctx, field, obj) + + case "Quarantined_books": + + out.Values[i] = ec._Teacher_Quarantined_books(ctx, field, obj) + + case "Teacher_backup_email": + + out.Values[i] = ec._Teacher_Teacher_backup_email(ctx, field, obj) + + case "Teacher_gender": + + out.Values[i] = ec._Teacher_Teacher_gender(ctx, field, obj) + + case "Teacher_pronoun": + + out.Values[i] = ec._Teacher_Teacher_pronoun(ctx, field, obj) + + case "Teacher_position": + + out.Values[i] = ec._Teacher_Teacher_position(ctx, field, obj) + + case "Teacher_grade_band": + + out.Values[i] = ec._Teacher_Teacher_grade_band(ctx, field, obj) + + case "Teacher_subjects": + + out.Values[i] = ec._Teacher_Teacher_subjects(ctx, field, obj) + + case "Teacher_provided_services": + + out.Values[i] = ec._Teacher_Teacher_provided_services(ctx, field, obj) + + case "Teacher_specialized_courses": + + out.Values[i] = ec._Teacher_Teacher_specialized_courses(ctx, field, obj) + + case "Teacher_state_id": + + out.Values[i] = ec._Teacher_Teacher_state_id(ctx, field, obj) + + case "Teacher_district": + + out.Values[i] = ec._Teacher_Teacher_district(ctx, field, obj) + + case "Teacher_school": + + out.Values[i] = ec._Teacher_Teacher_school(ctx, field, obj) + + case "Teacher_cell_phone": + + out.Values[i] = ec._Teacher_Teacher_cell_phone(ctx, field, obj) + + case "Teacher_texts_enabled": + + out.Values[i] = ec._Teacher_Teacher_texts_enabled(ctx, field, obj) + + case "Active": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -2788,7 +15298,7 @@ func (ec *executionContext) _Book(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Book_title(ctx, field, obj) + res = ec._Teacher_Active(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -2799,7 +15309,7 @@ func (ec *executionContext) _Book(ctx context.Context, sel ast.SelectionSet, obj return innerFunc(ctx) }) - case "author": + case "Teacher_date_created": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -2808,37 +15318,221 @@ func (ec *executionContext) _Book(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Book_author(ctx, field, obj) + res = ec._Teacher_Teacher_date_created(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res } - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Concurrently(i, func() graphql.Marshaler { + return innerFunc(ctx) + + }) + case "Teacher_date_updated": + 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._Teacher_Teacher_date_updated(ctx, field, obj) + 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 userImplementors = []string{"User"} + +func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors) + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("User") + case "id": + + out.Values[i] = ec._User_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "student_id": + + out.Values[i] = ec._User_student_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "student_app_id": + + out.Values[i] = ec._User_student_app_id(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "student_calpads_ssid": + + out.Values[i] = ec._User_student_calpads_ssid(ctx, field, obj) + + case "student_login_id": + + out.Values[i] = ec._User_student_login_id(ctx, field, obj) + + case "first_name": + + out.Values[i] = ec._User_first_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "middle_name": + + out.Values[i] = ec._User_middle_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "last_name": + + out.Values[i] = ec._User_last_name(ctx, field, obj) + + if out.Values[i] == graphql.Null { + invalids++ + } + case "date_created": + + out.Values[i] = ec._User_date_created(ctx, field, obj) + + case "date_updated": + + out.Values[i] = ec._User_date_updated(ctx, field, obj) + + case "preferred_name": + + out.Values[i] = ec._User_preferred_name(ctx, field, obj) + + case "gender": + + out.Values[i] = ec._User_gender(ctx, field, obj) + + case "pronoun": + + out.Values[i] = ec._User_pronoun(ctx, field, obj) + + case "birth_date": + + out.Values[i] = ec._User_birth_date(ctx, field, obj) + + case "grade_level": + + out.Values[i] = ec._User_grade_level(ctx, field, obj) + + case "grade_movement": + + out.Values[i] = ec._User_grade_movement(ctx, field, obj) + + case "guided_reading_level": + + out.Values[i] = ec._User_guided_reading_level(ctx, field, obj) + + case "rti_srv_type": + + out.Values[i] = ec._User_rti_srv_type(ctx, field, obj) + + case "student_services": + + out.Values[i] = ec._User_student_services(ctx, field, obj) + + case "rti_services": + + out.Values[i] = ec._User_rti_services(ctx, field, obj) + + case "specialized_courses": + + out.Values[i] = ec._User_specialized_courses(ctx, field, obj) + + case "grade_level_status": + + out.Values[i] = ec._User_grade_level_status(ctx, field, obj) + + case "lexile_level_min": + + out.Values[i] = ec._User_lexile_level_min(ctx, field, obj) + + case "lexile_level_max": + + out.Values[i] = ec._User_lexile_level_max(ctx, field, obj) + + case "type": + + out.Values[i] = ec._User_type(ctx, field, obj) + + case "weakness": + + out.Values[i] = ec._User_weakness(ctx, field, obj) + + case "reader_type": + + out.Values[i] = ec._User_reader_type(ctx, field, obj) + + case "reading_stage": + + out.Values[i] = ec._User_reading_stage(ctx, field, obj) + + case "ethnicity": + + out.Values[i] = ec._User_ethnicity(ctx, field, obj) + + case "avatar": + + out.Values[i] = ec._User_avatar(ctx, field, obj) + + case "backup_avatar": + + out.Values[i] = ec._User_backup_avatar(ctx, field, obj) + + case "self_assessment": + + out.Values[i] = ec._User_self_assessment(ctx, field, obj) + + case "reader_non_reader": + + out.Values[i] = ec._User_reader_non_reader(ctx, field, obj) + + case "read_goal": + + out.Values[i] = ec._User_read_goal(ctx, field, obj) + + case "type_of_reading": - }) - case "user": - field := field + out.Values[i] = ec._User_type_of_reading(ctx, field, obj) - innerFunc := func(ctx context.Context) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Book_user(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - } + case "book_finish": - out.Concurrently(i, func() graphql.Marshaler { - return innerFunc(ctx) + out.Values[i] = ec._User_book_finish(ctx, field, obj) + + case "read_speed": + + out.Values[i] = ec._User_read_speed(ctx, field, obj) - }) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -2850,65 +15544,86 @@ func (ec *executionContext) _Book(ctx context.Context, sel ast.SelectionSet, obj return out } -var mutationImplementors = []string{"Mutation"} - -func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Mutation", - }) +var userBookImplementors = []string{"UserBook"} +func (ec *executionContext) _UserBook(ctx context.Context, sel ast.SelectionSet, obj *model.UserBook) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, userBookImplementors) 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("Mutation") - case "createBook": + out.Values[i] = graphql.MarshalString("UserBook") + case "id": - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createBook(ctx, field) - }) + out.Values[i] = ec._UserBook_id(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + case "book_id": -var queryImplementors = []string{"Query"} + out.Values[i] = ec._UserBook_book_id(ctx, field, obj) -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", - }) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "book_type": - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - innerCtx := graphql.WithRootFieldContext(ctx, &graphql.RootFieldContext{ - Object: field.Name, - Field: field, - }) + out.Values[i] = ec._UserBook_book_type(ctx, field, obj) - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "books": + case "checkout_status": + + out.Values[i] = ec._UserBook_checkout_status(ctx, field, obj) + + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "condition": + + out.Values[i] = ec._UserBook_condition(ctx, field, obj) + + case "cover_image": + + out.Values[i] = ec._UserBook_cover_image(ctx, field, obj) + + case "date_created": + + out.Values[i] = ec._UserBook_date_created(ctx, field, obj) + + case "date_updated": + + out.Values[i] = ec._UserBook_date_updated(ctx, field, obj) + + case "format": + + out.Values[i] = ec._UserBook_format(ctx, field, obj) + + case "guided_reading_level": + + out.Values[i] = ec._UserBook_guided_reading_level(ctx, field, obj) + + case "lexile_level": + + out.Values[i] = ec._UserBook_lexile_level(ctx, field, obj) + + case "location": + + out.Values[i] = ec._UserBook_location(ctx, field, obj) + + case "mentor_text": + + out.Values[i] = ec._UserBook_mentor_text(ctx, field, obj) + + case "multiple_pov": + + out.Values[i] = ec._UserBook_multiple_pov(ctx, field, obj) + + case "price": + + out.Values[i] = ec._UserBook_price(ctx, field, obj) + + case "qty_label": field := field innerFunc := func(ctx context.Context) (res graphql.Marshaler) { @@ -2917,81 +15632,88 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_books(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._UserBook_qty_label(ctx, field, obj) 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": + return innerFunc(ctx) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___type(ctx, field) }) + case "series": - case "__schema": + out.Values[i] = ec._UserBook_series(ctx, field, obj) - out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Query___schema(ctx, field) - }) + case "series_name": - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} + out.Values[i] = ec._UserBook_series_name(ctx, field, obj) -var userImplementors = []string{"User"} + case "series_pos": -func (ec *executionContext) _User(ctx context.Context, sel ast.SelectionSet, obj *model.User) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, userImplementors) - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("User") - case "id": + out.Values[i] = ec._UserBook_series_pos(ctx, field, obj) - out.Values[i] = ec._User_id(ctx, field, obj) + case "tags": - if out.Values[i] == graphql.Null { - invalids++ - } - case "first_name": + out.Values[i] = ec._UserBook_tags(ctx, field, obj) - out.Values[i] = ec._User_first_name(ctx, field, obj) + case "teacher_notes": - if out.Values[i] == graphql.Null { - invalids++ - } - case "last_name": + out.Values[i] = ec._UserBook_teacher_notes(ctx, field, obj) - out.Values[i] = ec._User_last_name(ctx, field, obj) + case "teacher_read": + + out.Values[i] = ec._UserBook_teacher_read(ctx, field, obj) + + case "text_complexity": + + out.Values[i] = ec._UserBook_text_complexity(ctx, field, obj) + + case "unpaged": + + out.Values[i] = ec._UserBook_unpaged(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "email": + case "unreliable_narrative": + + out.Values[i] = ec._UserBook_unreliable_narrative(ctx, field, obj) - out.Values[i] = ec._User_email(ctx, field, obj) + case "user_id": + + out.Values[i] = ec._UserBook_user_id(ctx, field, obj) + + case "entered_user_id": + + out.Values[i] = ec._UserBook_entered_user_id(ctx, field, obj) + + case "want_for_classroom": + + out.Values[i] = ec._UserBook_want_for_classroom(ctx, field, obj) + + case "own_this_copy": + + out.Values[i] = ec._UserBook_own_this_copy(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } + case "want_to_discard": + + out.Values[i] = ec._UserBook_want_to_discard(ctx, field, obj) + + case "word_count": + + out.Values[i] = ec._UserBook_word_count(ctx, field, obj) + + case "words_per_page": + + out.Values[i] = ec._UserBook_words_per_page(ctx, field, obj) + + case "current_user_id": + + out.Values[i] = ec._UserBook_current_user_id(ctx, field, obj) + default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -3282,50 +16004,201 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o out.Values[i] = ec.___Type_fields(ctx, field, obj) - case "interfaces": + 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) marshalNBook2remoᚋbackendᚋgraphᚋmodelᚐBook(ctx context.Context, sel ast.SelectionSet, v model.Book) graphql.Marshaler { + return ec._Book(ctx, sel, &v) +} + +func (ec *executionContext) marshalNBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx context.Context, sel ast.SelectionSet, v *model.Book) 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._Book(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNBookInput2remoᚋbackendᚋgraphᚋmodelᚐBookInput(ctx context.Context, v interface{}) (model.BookInput, error) { + res, err := ec.unmarshalInputBookInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +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) marshalNClassroom2remoᚋbackendᚋgraphᚋmodelᚐClassroom(ctx context.Context, sel ast.SelectionSet, v model.Classroom) graphql.Marshaler { + return ec._Classroom(ctx, sel, &v) +} + +func (ec *executionContext) marshalNClassroom2ᚖremoᚋbackendᚋgraphᚋmodelᚐClassroom(ctx context.Context, sel ast.SelectionSet, v *model.Classroom) 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._Classroom(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNID2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNID2int(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) unmarshalNID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_interfaces(ctx, field, obj) +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 +} - case "possibleTypes": +func (ec *executionContext) unmarshalNInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) +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 +} - case "enumValues": +func (ec *executionContext) unmarshalNNewClassroom2remoᚋbackendᚋgraphᚋmodelᚐNewClassroom(ctx context.Context, v interface{}) (model.NewClassroom, error) { + res, err := ec.unmarshalInputNewClassroom(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_enumValues(ctx, field, obj) +func (ec *executionContext) unmarshalNNewStudent2remoᚋbackendᚋgraphᚋmodelᚐNewStudent(ctx context.Context, v interface{}) (model.NewStudent, error) { + res, err := ec.unmarshalInputNewStudent(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "inputFields": +func (ec *executionContext) unmarshalNNewTeacher2remoᚋbackendᚋgraphᚋmodelᚐNewTeacher(ctx context.Context, v interface{}) (model.NewTeacher, error) { + res, err := ec.unmarshalInputNewTeacher(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} - out.Values[i] = ec.___Type_inputFields(ctx, field, obj) +func (ec *executionContext) marshalNReadingRateResult2remoᚋbackendᚋgraphᚋmodelᚐReadingRateResult(ctx context.Context, sel ast.SelectionSet, v model.ReadingRateResult) graphql.Marshaler { + return ec._ReadingRateResult(ctx, sel, &v) +} - case "ofType": +func (ec *executionContext) marshalNReadingRateResult2ᚖremoᚋbackendᚋgraphᚋmodelᚐReadingRateResult(ctx context.Context, sel ast.SelectionSet, v *model.ReadingRateResult) 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._ReadingRateResult(ctx, sel, v) +} - out.Values[i] = ec.___Type_ofType(ctx, field, obj) +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} - case "specifiedByURL": +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 +} - out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) +func (ec *executionContext) marshalNStudent2remoᚋbackendᚋgraphᚋmodelᚐStudent(ctx context.Context, sel ast.SelectionSet, v model.Student) graphql.Marshaler { + return ec._Student(ctx, sel, &v) +} - default: - panic("unknown field " + strconv.Quote(field.Name)) +func (ec *executionContext) marshalNStudent2ᚖremoᚋbackendᚋgraphᚋmodelᚐStudent(ctx context.Context, sel ast.SelectionSet, v *model.Student) 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") } - } - out.Dispatch() - if invalids > 0 { return graphql.Null } - return out + return ec._Student(ctx, sel, v) } -// endregion **************************** object.gotpl **************************** - -// region ***************************** type.gotpl ***************************** - -func (ec *executionContext) marshalNBook2remoᚋbackendᚋgraphᚋmodelᚐBook(ctx context.Context, sel ast.SelectionSet, v model.Book) graphql.Marshaler { - return ec._Book(ctx, sel, &v) +func (ec *executionContext) marshalNTeacher2remoᚋbackendᚋgraphᚋmodelᚐTeacher(ctx context.Context, sel ast.SelectionSet, v model.Teacher) graphql.Marshaler { + return ec._Teacher(ctx, sel, &v) } -func (ec *executionContext) marshalNBook2ᚕᚖremoᚋbackendᚋgraphᚋmodelᚐBookᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Book) graphql.Marshaler { +func (ec *executionContext) marshalNTeacher2ᚕᚖremoᚋbackendᚋgraphᚋmodelᚐTeacherᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.Teacher) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -3349,7 +16222,7 @@ func (ec *executionContext) marshalNBook2ᚕᚖremoᚋbackendᚋgraphᚋmodelᚐ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx, sel, v[i]) + ret[i] = ec.marshalNTeacher2ᚖremoᚋbackendᚋgraphᚋmodelᚐTeacher(ctx, sel, v[i]) } if isLen1 { f(i) @@ -3369,58 +16242,23 @@ func (ec *executionContext) marshalNBook2ᚕᚖremoᚋbackendᚋgraphᚋmodelᚐ return ret } -func (ec *executionContext) marshalNBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx context.Context, sel ast.SelectionSet, v *model.Book) graphql.Marshaler { +func (ec *executionContext) marshalNTeacher2ᚖremoᚋbackendᚋgraphᚋmodelᚐTeacher(ctx context.Context, sel ast.SelectionSet, v *model.Teacher) 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._Book(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) 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) unmarshalNNewBook2remoᚋbackendᚋgraphᚋmodelᚐNewBook(ctx context.Context, v interface{}) (model.NewBook, error) { - res, err := ec.unmarshalInputNewBook(ctx, v) - return res, graphql.ErrorOnPath(ctx, err) + return ec._Teacher(ctx, sel, v) } -func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { - res, err := graphql.UnmarshalString(v) +func (ec *executionContext) unmarshalNTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { + res, err := graphql.UnmarshalTime(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) +func (ec *executionContext) marshalNTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { + res := graphql.MarshalTime(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") @@ -3429,20 +16267,6 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) marshalNUser2remoᚋbackendᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v model.User) graphql.Marshaler { - return ec._User(ctx, sel, &v) -} - -func (ec *executionContext) marshalNUser2ᚖremoᚋbackendᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) 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._User(ctx, sel, v) -} - 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) } @@ -3696,6 +16520,41 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } +func (ec *executionContext) unmarshalNdate2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNdate2string(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) unmarshalNnewReadingRateResults2remoᚋbackendᚋgraphᚋmodelᚐNewReadingRateResults(ctx context.Context, v interface{}) (model.NewReadingRateResults, error) { + res, err := ec.unmarshalInputnewReadingRateResults(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBook2ᚖremoᚋbackendᚋgraphᚋmodelᚐBook(ctx context.Context, sel ast.SelectionSet, v *model.Book) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Book(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOBookInput2ᚖremoᚋbackendᚋgraphᚋmodelᚐBookInput(ctx context.Context, v interface{}) (*model.BookInput, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputBookInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { res, err := graphql.UnmarshalBoolean(v) return res, graphql.ErrorOnPath(ctx, err) @@ -3722,6 +16581,88 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return res } +func (ec *executionContext) unmarshalOFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloatContext(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + res := graphql.MarshalFloatContext(v) + return graphql.WrapContextMarshaler(ctx, res) +} + +func (ec *executionContext) unmarshalOID2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOID2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + return res +} + +func (ec *executionContext) unmarshalOID2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalID(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOID2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalID(v) + return res +} + +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) unmarshalOInt2int(ctx context.Context, v interface{}) (int, error) { + res, err := graphql.UnmarshalInt(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2int(ctx context.Context, sel ast.SelectionSet, v int) graphql.Marshaler { + res := graphql.MarshalInt(v) + return res +} + +func (ec *executionContext) unmarshalOInt2ᚖint(ctx context.Context, v interface{}) (*int, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.SelectionSet, v *int) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalInt(*v) + return res +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + return res +} + func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { if v == nil { return nil, nil @@ -3738,6 +16679,39 @@ func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel as return res } +func (ec *executionContext) unmarshalOTime2timeᚐTime(ctx context.Context, v interface{}) (time.Time, error) { + res, err := graphql.UnmarshalTime(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTime2timeᚐTime(ctx context.Context, sel ast.SelectionSet, v time.Time) graphql.Marshaler { + res := graphql.MarshalTime(v) + return res +} + +func (ec *executionContext) unmarshalOTime2ᚖtimeᚐTime(ctx context.Context, v interface{}) (*time.Time, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalTime(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOTime2ᚖtimeᚐTime(ctx context.Context, sel ast.SelectionSet, v *time.Time) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalTime(*v) + return res +} + +func (ec *executionContext) marshalOUser2ᚖremoᚋbackendᚋgraphᚋmodelᚐUser(ctx context.Context, sel ast.SelectionSet, v *model.User) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._User(ctx, sel, v) +} + 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 @@ -3940,4 +16914,20 @@ func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgen return ec.___Type(ctx, sel, v) } +func (ec *executionContext) unmarshalOdate2ᚖ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) marshalOdate2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + res := graphql.MarshalString(*v) + return res +} + // endregion ***************************** type.gotpl ***************************** diff --git a/remo-backend/graph/model/book.go b/remo-backend/graph/model/book.go index c400020..66977b8 100644 --- a/remo-backend/graph/model/book.go +++ b/remo-backend/graph/model/book.go @@ -1,9 +1,54 @@ package model +import ( + "time" +) + type Book struct { - ID string `json:"id"` - Text string `json:"text"` - Done bool `json:"done"` - UserID string `json:"userId"` - User *User `json:"user"` + ID string `json:"id" gorm:"primary_key"` + Story_id string `json:"story_id"` + Author string `json:"author"` + Cover_image string `json:"cover_image"` + Date_created time.Time `json:"date_created"` + Date_updated time.Time `json:"date_updated"` + Default_user_id string `json:"default_user_id"` + Foreword string `json:"foreword"` + Editor string `json:"editor"` + Illustrator string `json:"illustrator"` + Isbn_10 string `json:"isbn_10"` + Isbn_13 int `json:"isbn_13"` + Num_pages int `json:"num_pages"` + Pub_date int `json:"pub_date"` + Copyright_date int `json:"copyright_date"` + Edition int `json:"edition"` + Synopsis string `json:"synopsis"` + Title string `json:"title"` + Word_count int `json:"word_count"` + Sub_title string `json:"sub_title"` + Asin string `json:"asin"` +} + +// UpdateBook +// Updates all the requested fields of this book using the BookInput +func (target *Book) UpdateBook(input BookInput) { + ReassignFieldString(input.StoryID, &target.Story_id) + ReassignFieldString(input.Author, &target.Author) + ReassignFieldString(input.CoverImage, &target.Cover_image) + ReassignFieldTime(input.DateCreated, &target.Date_created) + ReassignFieldTime(input.DateUpdated, &target.Date_updated) + ReassignFieldString(&input.DefaultUserID, &target.Default_user_id) + ReassignFieldString(input.Foreword, &target.Foreword) + ReassignFieldString(input.Editor, &target.Editor) + ReassignFieldString(input.Illustrator, &target.Illustrator) + ReassignFieldString(input.Isbn10, &target.Isbn_10) + ReassignFieldInt(input.Isbn13, &target.Isbn_13) + ReassignFieldInt(input.NumPages, &target.Num_pages) + ReassignFieldInt(input.PubDate, &target.Pub_date) + ReassignFieldInt(input.CopyrightDate, &target.Copyright_date) + ReassignFieldInt(input.Edition, &target.Edition) + ReassignFieldString(input.Synopsis, &target.Synopsis) + ReassignFieldString(input.Title, &target.Title) + ReassignFieldInt(input.WordCount, &target.Word_count) + ReassignFieldString(input.SubTitle, &target.Sub_title) + ReassignFieldString(input.Asin, &target.Asin) } diff --git a/remo-backend/graph/model/book_test.go b/remo-backend/graph/model/book_test.go new file mode 100644 index 0000000..c1908be --- /dev/null +++ b/remo-backend/graph/model/book_test.go @@ -0,0 +1,77 @@ +package model + +import ( + "testing" + "time" +) + +type reassignFieldTest struct { + input, target, expected *string +} + +var mtStringVal = "" +var mtStringPtr = &mtStringVal +var testStringVal = "test" +var testStringPtr = &testStringVal +var existStringVal = "existing" +var existStringPtr = &existStringVal + +var reassignFieldTests = []reassignFieldTest{ + {mtStringPtr, nil, mtStringPtr}, + {testStringPtr, nil, testStringPtr}, + {testStringPtr, existStringPtr, testStringPtr}, + {mtStringPtr, existStringPtr, mtStringPtr}, + {testStringPtr, mtStringPtr, testStringPtr}, + {testStringPtr, testStringPtr, testStringPtr}, + {nil, nil, nil}, +} + +func TestReassignFieldString(t *testing.T) { + for _, test := range reassignFieldTests { + ReassignFieldString(test.input, test.target) + if output := test.input; output != test.expected { + t.Errorf("Output %q not equal to expected %q", *output, *test.expected) + } + } +} + +type updateBookTest struct { + input *BookInput + target *Book +} + +var one = 1 +var intPtr = &one +var jrr = "jrr" +var authPtr = &jrr +var now = time.Now() +var nowPtr = &now + +var updateBookTests = []updateBookTest{ + {&BookInput{ID: "1", DefaultUserID: "1", StoryID: mtStringPtr, NumPages: intPtr, Author: authPtr, DateUpdated: nowPtr}, + &Book{ID: "1", Default_user_id: "1", Story_id: "1", Num_pages: 1}}, +} + +func TestUpdateBook(t *testing.T) { + for _, test := range updateBookTests { + test.target.UpdateBook(*test.input) + if test.target.ID != test.input.ID { + t.Errorf("Books IDs not equal") + } + if output := test.target.Default_user_id; output != test.input.DefaultUserID { + t.Errorf("Output %q not equal to expected %q", output, test.input.DefaultUserID) + } + if output := test.target.Story_id; output != *test.input.StoryID { + t.Errorf("Output %q not equal to expected %q", output, *test.input.StoryID) + } + if output := test.target.Num_pages; output != *test.input.NumPages { + t.Errorf("Output %q not equal to expected %q", output, *test.input.NumPages) + } + if output := test.target.Author; output != *test.input.Author { + t.Errorf("Output %q not equal to expected %q", output, *test.input.Author) + } + if output := test.target.Date_updated; output != *test.input.DateUpdated { + t.Errorf("Output %q not equal to expected %q", output, *test.input.DateUpdated) + } + } +} diff --git a/remo-backend/graph/model/classroom.go b/remo-backend/graph/model/classroom.go new file mode 100644 index 0000000..ba3c827 --- /dev/null +++ b/remo-backend/graph/model/classroom.go @@ -0,0 +1,40 @@ +package model + +import ( + "time" +) + +type Classroom struct { + ClassroomId int `json:"classroomId"` + Classroom_school_id int `json:"classroom_school_id"` + // DOUBLE-CHECK THE TYPE ON THIS + Classroom_school_year time.Time `json:"classroom_school_year"` + Classroom_start_date time.Time `json:"classroom_start_date"` + Classroom_end_date time.Time `json:"classroom_end_date"` + Classroom_name time.Time `json:"classroom_name"` + Classroom_subject time.Time `json:"classroom_subject"` + Classroom_display_name time.Time `json:"classroom_display_name"` + Classroom_avg_length time.Time `json:"classroom_avg_length"` + // HOW TO DEAL WITH THIS? WHICH TYPES CAN BE ENCODED INTO A JSON? + // Might be a way apparently where it just knows which numbers correspond to which values + //classroom_avg_frequency int DEFAULT NULL COMMENT '1 = weekly 2 = bi-weekly 3 = monthly 4 = yearly', + Classroom_avg_days int `json:"classroom_avg_days"` + Classroom_grade_level_type int `json:"classroom_grade_level_type"` + Classroom_grade_level string `json:"classroom_grade_level"` + Classroom_co_teacher_id int `json:"classroom_co_teacher_id"` + Classroom_teacher_idV1 int `json:"classroom_teacher_idV1"` + Classroom_num_students int `json:"classroom_num_students"` + Classroom_num_seats int `json:"classroom_num_seats"` + // HOW TO DEAL WITH THIS? WHICH TYPES CAN BE ENCODED INTO A JSON? + //classroom_student_sign_in_mode int DEFAULT NULL COMMENT '1 - Shared (QR or Google code), 2 - Single-user (email/pass).', + //classroom_can_share_books int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + //classroom_can_view_prompt_replies int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + //classroom_can_view_survey_results int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + //classroom_can_view_teacher_bookshelves int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + //classroom_enable_family_access int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + //classroom_status_id int NOT NULL DEFAULT '0' COMMENT '0 = inactive, 1= active, 2 =archived', + Classroom_conf_frequency_above int `json:"classroom_conf_frequency_above"` + Classroom_conf_frequency_on int `json:"classroom_conf_frequency_on"` + Classroom_conf_frequency_below int `json:"classroom_conf_frequency_below"` + Classroom_conf_frequency_far_below int `json:"classroom_conf_frequency_far_below"` +} diff --git a/remo-backend/graph/model/models.go b/remo-backend/graph/model/models.go new file mode 100644 index 0000000..e9236bb --- /dev/null +++ b/remo-backend/graph/model/models.go @@ -0,0 +1,15 @@ +package model + +import ( + _ "github.com/go-sql-driver/mysql" + "github.com/jinzhu/gorm" +) + +func FetchConnection() *gorm.DB { + db, err := gorm.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") + + if err != nil { + panic(err) + } + return db +} diff --git a/remo-backend/graph/model/models_gen.go b/remo-backend/graph/model/models_gen.go index 79836e0..1ae90bc 100644 --- a/remo-backend/graph/model/models_gen.go +++ b/remo-backend/graph/model/models_gen.go @@ -2,15 +2,99 @@ package model -type NewBook struct { - Title string `json:"title"` - Author string `json:"author"` - UserID string `json:"userId"` +import ( + "time" +) + +type BookInput struct { + ID string `json:"id"` + StoryID *string `json:"story_id"` + Author *string `json:"author"` + CoverImage *string `json:"cover_image"` + DateCreated *time.Time `json:"date_created"` + DateUpdated *time.Time `json:"date_updated"` + DefaultUserID string `json:"default_user_id"` + Foreword *string `json:"foreword"` + Editor *string `json:"editor"` + Illustrator *string `json:"illustrator"` + Isbn10 *string `json:"isbn_10"` + Isbn13 *int `json:"isbn_13"` + NumPages *int `json:"num_pages"` + PubDate *int `json:"pub_date"` + CopyrightDate *int `json:"copyright_date"` + Edition *int `json:"edition"` + Synopsis *string `json:"synopsis"` + Title *string `json:"title"` + WordCount *int `json:"word_count"` + SubTitle *string `json:"sub_title"` + Asin *string `json:"asin"` +} + +type NewClassroom struct { + ClassroomID string `json:"classroom_id"` + ClassroomCoTeacherID string `json:"Classroom_co_teacher_id"` + ClassroomStatusID string `json:"classroom_status_id"` +} + +type NewStudent struct { + ID string `json:"id"` + StudentID string `json:"Student_id"` + StudentAppID string `json:"student_app_id"` + FirstName string `json:"First_name"` + MiddleName string `json:"Middle_name"` + LastName string `json:"last_name"` +} + +type NewTeacher struct { + ID string `json:"id"` + TeacherFirstName string `json:"Teacher_first_name"` + TeacherLastName string `json:"Teacher_last_name"` + Active int `json:"Active"` + TeacherDateCreated time.Time `json:"Teacher_date_created"` + TeacherDateUpdated time.Time `json:"Teacher_date_updated"` } type User struct { - ID string `json:"id"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Email string `json:"email"` + ID string `json:"id"` + StudentID string `json:"student_id"` + StudentAppID string `json:"student_app_id"` + StudentCalpadsSsid *string `json:"student_calpads_ssid"` + StudentLoginID *int `json:"student_login_id"` + FirstName string `json:"first_name"` + MiddleName string `json:"middle_name"` + LastName string `json:"last_name"` + DateCreated *int `json:"date_created"` + DateUpdated *int `json:"date_updated"` + PreferredName *string `json:"preferred_name"` + Gender *int `json:"gender"` + Pronoun *int `json:"pronoun"` + BirthDate *string `json:"birth_date"` + GradeLevel *int `json:"grade_level"` + GradeMovement *int `json:"grade_movement"` + GuidedReadingLevel *string `json:"guided_reading_level"` + RtiSrvType *int `json:"rti_srv_type"` + StudentServices *string `json:"student_services"` + RtiServices *string `json:"rti_services"` + SpecializedCourses *string `json:"specialized_courses"` + GradeLevelStatus *int `json:"grade_level_status"` + LexileLevelMin *int `json:"lexile_level_min"` + LexileLevelMax *int `json:"lexile_level_max"` + Type *int `json:"type"` + Weakness *int `json:"weakness"` + ReaderType *int `json:"reader_type"` + ReadingStage *int `json:"reading_stage"` + Ethnicity *int `json:"ethnicity"` + Avatar *string `json:"avatar"` + BackupAvatar *string `json:"backup_avatar"` + SelfAssessment *int `json:"self_assessment"` + ReaderNonReader *int `json:"reader_non_reader"` + ReadGoal *int `json:"read_goal"` + TypeOfReading *int `json:"type_of_reading"` + BookFinish *int `json:"book_finish"` + ReadSpeed *int `json:"read_speed"` +} + +type NewReadingRateResults struct { + ReadingRateResultsID string `json:"Reading_rate_results_id"` + WordsPerPage int `json:"Words_per_page"` } diff --git a/remo-backend/graph/model/reading_rate_result.go b/remo-backend/graph/model/reading_rate_result.go new file mode 100644 index 0000000..4154cf1 --- /dev/null +++ b/remo-backend/graph/model/reading_rate_result.go @@ -0,0 +1,47 @@ +package model + +import ( + "time" +) + +type ReadingRateResult struct { + Reading_rate_results_id int `json:"reading_rate_results_id"` + User_id int `json:"user_id"` + Book_id int `json:"nook_id"` + User_book_id int `json:"user_book_id"` + //`date` datetime DEFAULT NULL, + Date time.Time `json:"date"` + //`reading_location` int DEFAULT NULL COMMENT '1 = school, 2 = home', + Reading_location int `json:"reading_location"` + //`type_of_reading` int DEFAULT NULL COMMENT '1=myself,2=someone else, 3=to me, 4= share read', + Type_of_reading int `json:"type_of_reading"` + Reading_setting int `json:"reading_setting"` + //`reading_type_details` int DEFAULT NULL COMMENT '1=Silent, 2=Aloud,3=Adult,4=teen,5=child,6=young child', + Reading_type_details int `json:"reading_type_details"` + //`start_time` time DEFAULT NULL, + Start_time time.Time `json:"start_time"` + //`end_time` time DEFAULT NULL, + End_time time.Time `json:"end_time"` + Total_time int `json:"Total_time"` + Start_page int `json:"start_page"` + End_page int `json:"end_page"` + Total_pages int `json:"total_pages"` + Word_per_page int `json:"word_per_page"` + Types_of_reading string `json:"types_of_reading"` + Section_rating int `json:"section_rating"` + Check_in int `json:"check_in"` + Reader_request int `json:"reader_request"` + Reader_request_almost_finished int `json:"reader_request_almost_finished"` + Reader_continuum int `json:"reader_continuum"` + Words_per_page int `json:"words_per_page"` + Observational_notes string `json:"observational_notes"` + //`share_feedback` int DEFAULT NULL, + Share_feedback int `json:"share_feedback"` + Reader_response string `json:"reader_response"` + Reading_response_pages string `json:"reading_response_pages"` + Reading_response_type int `json:"reading_response_type"` + Reading_response_subtype int `json:"reading_response_subtype"` + Grade_level int `json:"grade_level"` + Grade_level_status int `json:"grade_level_status"` + Teacher_id int `json:"teacher_id"` +} diff --git a/remo-backend/graph/model/student.go b/remo-backend/graph/model/student.go new file mode 100644 index 0000000..7ff4b5d --- /dev/null +++ b/remo-backend/graph/model/student.go @@ -0,0 +1,65 @@ +package model + +import ( + "time" +) + +type Student struct { + Id int `json:"classroomId"` + //`student_id` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL, + Student_id string `json:"student_id"` + //`student_app_id` varchar(32) NOT NULL, + Student_app_id string `json:"student_app_id"` + //`student_calpads_ssid` varchar(32) DEFAULT NULL COMMENT 'CALPADS SSID value.', + Student_calpads_ssid string `json:"student_calpads_ssid"` + Student_login_id int `json:"student_login_id"` + First_name string `json:"first_name"` + Middle_name string `json:"middle_name"` + Last_name string `json:"last_name"` + //`date_created` timestamp(6) NULL DEFAULT NULL, + Date_created time.Time `json:"date_created"` + //`date_updated` timestamp(6) NULL DEFAULT NULL, + Date_updated time.Time `json:"date_updated"` + Preferred_name string `json:"preferred_name"` + //`gender` int DEFAULT NULL, + Gender int `json:"gender"` + //`pronoun` int DEFAULT NULL, + Pronoun int `json:"pronoun"` + //`birth_date` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL, + Birth_date string `json:"birth_date"` + Grade_level int `json:"grade_level"` + Grade_movement int `json:"grade_movement"` + //`guided_reading_level` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL, + Guided_reading_level string `json:"guided_reading_level"` + //`rti_srv_type` int DEFAULT NULL, + Rti_srv_type string `json:"rti_srv_type"` + //`student_services` varchar(32) DEFAULT NULL COMMENT 'CSL of Student Identified Services', + Student_services string `json:"student_services"` + //`rti_services` varchar(28) DEFAULT NULL COMMENT 'CSL of RTI Services', + Rti_services string `json:"rti_services"` + //`specialized_courses` varchar(32) DEFAULT NULL COMMENT 'c.s.l. of ids from specialized_courses_fields table', + Specialized_courses string `json:"specialized_courses"` + //`grade_level_status` int DEFAULT NULL COMMENT 'Labeled as Level of Student', + Grade_level_status int `json:"grade_level_status"` + Lexile_level_min int `json:"lexile_level_min"` + Lexile_level_max int `json:"lexile_level_max"` + //`type` int DEFAULT NULL COMMENT 'Labeled as Type of Student', + Type int `json:"type"` + //`weakness` int DEFAULT NULL COMMENT 'fluency or comprehension', + Weakness int `json:"weakness"` + //`reader_type` int DEFAULT NULL COMMENT 'Theme or Plot', + Reader_type int `json:"reader_type"` + Reading_stage int `json:"reading_stage"` + //`DELETEself_assessment` int DEFAULT NULL COMMENT 'self assessment how does student feel about reading', + //`DELETEreader_non_reader` int DEFAULT NULL COMMENT 'self assessment reader or non-reader 1 is yes or 2 is no', + //`DELETEread_goal` int DEFAULT NULL COMMENT 'Number of books student wants to read in a year', + //`DELETEtype_of_reading` int DEFAULT NULL COMMENT '1-Fiction, 2-Non-Fiction,3-No Preference', + //`DELETEbook_finish` int DEFAULT NULL COMMENT 'How often does a student finish a book? 5(Most)-1(Never)', + //`DELETEread_speed` int DEFAULT NULL COMMENT '1.fast,2.avg,3.slow', + //`ethnicity` int DEFAULT NULL, + Ethnicity int `json:"ethnicity"` + //`avatar` varchar(64) DEFAULT NULL, + Avatar string `json:"avatar"` + //`backup_avatar` varchar(64) DEFAULT NULL, + Backup_avatar string `json:"backup_avatar"` +} diff --git a/remo-backend/graph/model/teacher.go b/remo-backend/graph/model/teacher.go new file mode 100644 index 0000000..507628e --- /dev/null +++ b/remo-backend/graph/model/teacher.go @@ -0,0 +1,44 @@ +package model + +import ( + "time" +) + +type Teacher struct { + Teacher_id int `json:"teacher_id"` + Teacher_login_id int `json:"teacher_login_id"` + Teacher_title string `json:"teacher_title"` + Teacher_first_name string `json:"teacher_first_name"` + Teacher_middle_name string `json:"teacher_middle_name"` + Teacher_last_name string `json:"teacher_last_name"` + Teacher_suffix string `json:"teacher_suffix"` + Teacher_date_of_birth time.Time `json:"teacher_date_of_birth"` + Teacher_date_started_teaching string `json:"teacher_date_started_teaching"` + Degree_level_id int `json:"degree_level_id"` + Is_certified bool `json:"is_certified"` + Certification_id int `json:"certification_id"` + Certification_start string `json:"certification_start"` + Certification_end string `json:"certification_end"` + Teacher_avatar string `json:"teacher_avatar"` + Teacher_backup_avater string `json:"teacher_backup_avater"` + Teacher_subscription_type int `json:"teacher_subscription_type"` + Teacher_code_name string `json:"teacher_code_name"` + Teacher_display_name string `json:"teacher_display_name"` + Quarantined_books bool `json:"quarantined_books"` + Teacher_backup_email string `json:"teacher_backup_email"` + Teacher_gender string `json:"teacher_gender"` + Teacher_pronoun string `json:"teacher_pronoun"` + Teacher_position int `json:"teacher_position"` + Teacher_grade_band string `json:"teacher_grade_band"` + Teacher_subjects string `json:"teacher_subjects"` + Teacher_provided_services string `json:"teacher_provided_services"` + Teacher_specialized_courses string `json:"teacher_specialized_courses"` + Teacher_state_id string `json:"teacher_state_id"` + Teacher_district string `json:"teacher_district"` + Teacher_school string `json:"teacher_school"` + Teacher_cell_phone string `json:"teacher_cell_phone"` + Teacher_texts_enabled int `json:"teacher_texts_enabled"` + Active bool `json:"active"` + Teacher_date_created time.Time `json:"teacher_date_created"` + Teacher_date_updated time.Time `json:"teacher_date_updated"` +} diff --git a/remo-backend/graph/model/user_book.go b/remo-backend/graph/model/user_book.go new file mode 100644 index 0000000..369d33d --- /dev/null +++ b/remo-backend/graph/model/user_book.go @@ -0,0 +1,53 @@ +package model + +import ( + "time" +) + +type UserBook struct { + Id int `json:"id"` + Book_id int `json:"book_id"` + //COMMENT '1=fiction,2=non-ficiton,3=blended', + Book_type int `json:"book_type"` + //NOT NULL DEFAULT '4' COMMENT 'id from ''checkout_status_fields'' table.', + Checkout_status int `json:"checkout_status"` + Condition int `json:"condition"` + Cover_image string `json:"cover_image"` + //`date_created` timestamp NULL DEFAULT NULL, + Date_created time.Time `json:"date_created"` + //`date_updated` timestamp NULL DEFAULT NULL, + Date_updated time.Time `json:"date_updated"` + //`format` int DEFAULT NULL COMMENT '1=hardcover,2=PaperBack,3=ebook,4=audio,5=other', + Format int `json:"format"` + Guided_reading_level string `json:"guided_reading_level"` + Lexile_level int `json:"lexile_level"` + Location int `json:"location"` + Mentor_text int `json:"mentor_text"` + Multiple_pov int `json:"multiple_pov"` + //price decimal(13,2) DEFAULT NULL, + Price float64 `json:"price"` + Gty_label int `json:"qty_label"` + //`series` int DEFAULT NULL, + Series int `json:"series"` + Series_name string `json:"classroom_school_year"` + Series_pos int `json:"series_pos"` + Tags string `json:"tags"` + Teacher_notes string `json:"teacher_notes"` + Teacher_read int `json:"teacher_read"` + Text_complexity int `json:"text_complexity"` + //unpaged int NOT NULL DEFAULT '0', + Unpaged int `json:"unpaged"` + Unreliable_narrative int `json:"unreliable_narrative"` + User_id int `json:"user_id"` + //`entered_user_id` int DEFAULT NULL COMMENT 'user that entered the book in ReMo', + Entered_user_id int `json:"entered_user_id"` + Want_for_classroom int `json:"want_for_classroom"` + //`own_this_copy` int NOT NULL DEFAULT '0' COMMENT '0=unspecified 1=user 2=school 3=School Library', + Own_this_copy int `json:"own_this_copy"` + Want_to_discard int `json:"want_to_discard"` + Word_count int `json:"word_count"` + Words_per_page int `json:"words_per_page"` + Current_user_id int `json:"current_user_id"` + //PRIMARY KEY (`id`), + //KEY `tags` (`tags`(255)) +} diff --git a/remo-backend/graph/model/utils.go b/remo-backend/graph/model/utils.go new file mode 100644 index 0000000..8087eea --- /dev/null +++ b/remo-backend/graph/model/utils.go @@ -0,0 +1,45 @@ +package model + +import "time" + +// ReassignFieldInt +// Helper function to update the value of the target Int if the input Int is not null. +func ReassignFieldInt(input *int, target *int) { + if input != nil { + // case where there is no entry in this field yet + if target == nil { + target = input + // case where there is already an entry in this field + } else { + *target = *input + } + } +} + +// ReassignFieldTime +// Helper function to update the value of the target Time if the input Time is not null. +func ReassignFieldTime(input *time.Time, target *time.Time) { + if input != nil { + // case where there is no entry in this field yet + if target == nil { + target = input + // case where there is already an entry in this field + } else { + *target = *input + } + } +} + +// / ReassignFieldString +// Helper function to update the value of the target string if the input string is not null. +func ReassignFieldString(input *string, target *string) { + if input != nil { + // case where there is no entry in this field yet + if target == nil { + target = input + // case where there is already an entry in this field + } else { + *target = *input + } + } +} diff --git a/remo-backend/graph/resolver.go b/remo-backend/graph/resolver.go index aa17e7d..58c6336 100644 --- a/remo-backend/graph/resolver.go +++ b/remo-backend/graph/resolver.go @@ -1,11 +1,18 @@ package graph -import "remo/backend/graph/model" +//go:generate go run github.com/99designs/gqlgen generate +import ( + "remo/backend/graph/model" +) // This file will not be regenerated automatically. // // It serves as dependency injection for your app, add any dependencies you require here. type Resolver struct { - books []*model.Book + //Books map[string]*model.Book + Books []*model.Book + teachers []*model.Teacher + users []*model.User + //users map[string]*model.User } diff --git a/remo-backend/graph/resolver_test.go b/remo-backend/graph/resolver_test.go new file mode 100644 index 0000000..c36db83 --- /dev/null +++ b/remo-backend/graph/resolver_test.go @@ -0,0 +1,292 @@ +package graph + +import ( + "context" + "fmt" + "log" + "remo/backend/graph/model" + "strconv" + "testing" + "time" +) + +// SETUP VARIABLES + +var qResolver = queryResolver{} +var mResolver = mutationResolver{} + +// QUERY TESTS + +// Function to test resolver for query the database for books +func TestGetBookByISBN(t *testing.T) { + // isbn_13 of the book we want to retrieve + expectedISBN_13 := 9781525303890 + + // call the resolver's GetBookByID method with the requested expectedBookID + book, err := qResolver.GetBookByIsbn(context.Background(), expectedISBN_13) + if err != nil { + t.Errorf("GetBookByISBN failed: %v", err) + } + // trigger fail when retrieved book has incorrect ISBN_13 + if book.Isbn_13 != expectedISBN_13 { + t.Errorf("Retrieved book has incorrect isbn_13. Actual: %[1]v \n Expected: %[2]v \n", book.ID, expectedISBN_13) + } + + // same as above, just with incorrect isbn_10 number to check searching for isbn_10 + unexpectedISBN_13 := 1525303899 + book2, err2 := qResolver.GetBookByIsbn(context.Background(), unexpectedISBN_13) + // Error when getBookByISBN fails + if err2 != nil { + t.Errorf("GetBookByISBN failed: %v", err2) + } + // trigger fail when retrieved book has incorrect ISBN_10 + // should be triggered after checking for isbn_13 + var isbn10_test = strconv.Itoa(unexpectedISBN_13) + if book2.Isbn_10 != isbn10_test { + t.Errorf("Retrieved book has incorrect isbn_10. Actual: %[1]v \n Expected: %[2]v \n", book.ID, isbn10_test) + } +} + +// Function to test the query resolver for users +func TestGetUserByID(t *testing.T) { + // the user ID which we want to retrieve + expectedUserID := "1" + + // call the query resolver's GetUserByID method + user, err := qResolver.GetUserByID(context.Background(), expectedUserID) + if err != nil { + t.Errorf("GetUserByID failed: %v", err) + } + // trigger fail when retrieved book has incorrect ID + if user.ID != expectedUserID { + t.Errorf("Retrieved user has incorrect ID. Actual: %[1]v \n Expected: %[2]v \n", user.ID, expectedUserID) + } +} + +// query resolvers for teachers +func TestQueryResolver_Teachers(t *testing.T) { + log.Println("hello") + + // Call the resolver method + teachers, err := qResolver.Teachers(context.Background()) + if err != nil { + t.Errorf("Error calling Teachers resolver: %s", err) + } + + //fmt.Println("Number of teachers found: %d\n", len(teachers)) + + for i, teacher := range teachers { + fmt.Printf("Teacher %d: %v\n", i+1, teacher) + } + + if len(teachers) == 60 { + fmt.Print("Something went good") + } + log.Println(len(teachers)) +} + +// MUTATION TESTS + +func TestCreateBook(t *testing.T) { + // create a new book input + storyID := "50" + author := "John Doe" + coverImage := "https://example.com/cover.jpg" + dateCreated := time.Now().UTC() + dateUpdated := time.Now().UTC() + foreword := "This is the foreword." + editor := "Jane Doe" + illustrator := "Jack Smith" + isbn10 := "0123456789" + isbn13 := 123456789012 + numPages := 100 + pubDate := 2500 + copyrightDate := 2300 + edition := 1 + synopsis := "This is the book's synopsis." + title := "My Book" + wordCount := 50000 + subTitle := "A great book" + asin := "B08L5M82TR" + + bookInput := model.BookInput{ + StoryID: &storyID, + Author: &author, + CoverImage: &coverImage, + DateCreated: &dateCreated, + DateUpdated: &dateUpdated, + DefaultUserID: "30", + Foreword: &foreword, + Editor: &editor, + Illustrator: &illustrator, + Isbn10: &isbn10, + Isbn13: &isbn13, + NumPages: &numPages, + PubDate: &pubDate, + CopyrightDate: ©rightDate, + Edition: &edition, + Synopsis: &synopsis, + Title: &title, + WordCount: &wordCount, + SubTitle: &subTitle, + Asin: &asin, + } + + // call the resolver's CreateBook method with the book input + book, err := mResolver.CreateBook(context.Background(), bookInput) + if err != nil { + t.Fatalf("CreateBook failed: %v", err) + } + + // verify that the book's properties match the input + + if &book.Story_id != bookInput.StoryID { + print("Expected StoryID %q, got %q", bookInput.StoryID, &book.Story_id) + } + if &book.Author != bookInput.Author { + print("Expected Author %q, got %q", bookInput.Author, &book.Author) + } + if &book.Cover_image != bookInput.CoverImage { + print("Expected Cover_image %q, got %q", bookInput.CoverImage, &book.Cover_image) + } + if &book.Date_created != bookInput.DateCreated { + print("Expected Date_created %q, got %q", bookInput.DateCreated, &book.Author) + } + if &book.Date_updated != bookInput.DateUpdated { + print("Expected Date_updated %q, got %q", bookInput.DateUpdated, &book.Date_updated) + } + if &book.Default_user_id != &bookInput.DefaultUserID { + print("Expected Default_user_id %q, got %q", bookInput.DefaultUserID, &book.Default_user_id) + } + if &book.Foreword != bookInput.Foreword { + print("Expected Foreword %q, got %q", bookInput.Foreword, &book.Foreword) + } + if &book.Editor != bookInput.Editor { + print("Expected Editor %q, got %q", bookInput.Editor, &book.Editor) + } + if &book.Illustrator != bookInput.Illustrator { + print("Expected Illustrator %q, got %q", bookInput.Illustrator, &book.Illustrator) + } + if &book.Isbn_10 != bookInput.Isbn10 { + print("Expected Isbn_10 %q, got %q", bookInput.Isbn10, &book.Isbn_10) + } + if &book.Isbn_13 != bookInput.Isbn13 { + print("Expected Isbn_13 %q, got %q", bookInput.Isbn13, &book.Isbn_13) + } + if &book.Num_pages != bookInput.NumPages { + print("Expected Num_pages %q, got %q", bookInput.NumPages, &book.Num_pages) + } + +} + +func TestCreateTeacher(t *testing.T) { + // create a new teacher input + + input := model.NewTeacher{ + Active: 0, + TeacherDateCreated: time.Now(), + TeacherDateUpdated: time.Now(), + TeacherFirstName: "John", + TeacherLastName: "Doe", + } + + // Execute the function + + // call the resolver's CreateTeacher method with the book input + teacher, err := mResolver.CreateTeacher(context.Background(), input) + if err != nil { + t.Fatalf("CreateTeacher failed: %v", err) + } + if &teacher.Active == &teacher.Active { + + } + // tests are buggy because its saying that the Active field is a boolean in the models package when it + // clearly isn't -> still able to createTeacher if using task (select * from teacher where teacher_first_name = "John"; will produce + // or any other input) + + // if &input.Active != &teacher.Active { + // print("Expected StoryID %q, got %q", input.Active, teacher.Active) + // } + // if &input.TeacherDateCreated != &teacher.TeacherDateUpdated { + // print("Expected Author %q, got %q", input.TeacherDateCreated, &teacher.TeacherDateUpdated) + // } +} + +func TestCreateClassroom(t *testing.T) { + // create a new classroom input + teachID := "50" + statusID := "42069" + + input := model.NewClassroom{ + ClassroomCoTeacherID: teachID, + ClassroomStatusID: statusID, + } + + // Execute the function + + // call the resolver's CreateClassroom method with the book input + classroom, err := mResolver.CreateClassroom(context.Background(), input) + if err != nil { + t.Fatalf("CreateClassroom failed: %v", err) + } + + // Just like the last createTeacher test, this one isn't updating the fields from schema.graphqls, but when + // run "select * from classroom where classroom_status_id = 42069;" in task, it shows that it was able to inject it + if &classroom == &classroom { + + } +} + +func TestCreateStudent(t *testing.T) { + // create a new student input + StudentID := "50" + StudentAppID := "42069" + FirstName := "John" + MiddleName := "Love" + LastName := "Doe" + + input := model.NewStudent{ + StudentID: StudentID, + StudentAppID: StudentAppID, + FirstName: FirstName, + MiddleName: MiddleName, + LastName: LastName, + } + + // Execute the function + + // call the resolver's CreateStudent method with the book input + student, err := mResolver.CreateStudent(context.Background(), input) + if err != nil { + t.Fatalf("CreateStudent failed: %v", err) + } + + // Just like the last createTeacher test, this one isn't updating the fields from schema.graphqls, but when + // run "select * from student_info where student_id = 50;" in task terminal, it shows that it was able to inject it + if &student == &student { + + } +} + +func TestCreateReadingRate(t *testing.T) { + // create a new reading result input + WordsPerPage := 601 + + input := model.NewReadingRateResults{ + WordsPerPage: WordsPerPage, + } + + // Execute the function + + // call the resolver's CreateNewReadingRateResults method with the book input + readingResult, err := mResolver.CreateNewReadingRateResults(context.Background(), input) + if err != nil { + t.Fatalf("CreateNewReadingRateResults failed: %v", err) + } + + // Just like the last createTeacher test, this one isn't updating the fields from schema.graphqls, but when + // run "select * from reading_rate_results where word_per_page = 601;" in task terminal, it shows that it was able to inject it + if &readingResult == &readingResult { + + } +} diff --git a/remo-backend/graph/schema.graphqls b/remo-backend/graph/schema.graphqls index d8de4b1..9519af8 100644 --- a/remo-backend/graph/schema.graphqls +++ b/remo-backend/graph/schema.graphqls @@ -2,30 +2,356 @@ # # https://gqlgen.com/getting-started/ -type Book { - id: ID! - title: String! - author: String! - user: User! +# Maps a Time GraphQL scalar to a Go time.Time struct. This scalar adheres to the time.RFC3339Nano format. +# https://gqlgen.com/reference/scalars/ +scalar Time +scalar date + +#Maps an arbitrary GraphQL value to a map[string]interface{} Go type +scalar Map + +type Query { + # Book queries + #books: [Book!]! + getBookByISBN(isbn: Int!): Book + #getBookByTitle(title: String!): Book + + teachers: [Teacher!]! + + # User queries + #users: [User!]! + getUserByID(id: ID!): User + #getUserByLastName(last_name: String!): User + #getUserByEmail(email: String!): User +} + +type Teacher { + teacher_ID: ID! + Teacher_login_id: ID #ID from logins table + Teacher_title: String + Teacher_first_name: String! + Teacher_middle_name: String + Teacher_last_name: String! + Teacher_suffix: String + Teacher_date_of_birth: date + Teacher_date_started_teaching: String + Degree_level_id: ID + Is_certified: Boolean + Certification_id: ID + Certification_start: String + Certification_end: String + Teacher_avatar: String + Teacher_backup_avater: String + Teacher_subscription_type: Int + Teacher_code_name: String + Teacher_display_name: String + Quarantined_books: Boolean + Teacher_backup_email: String + Teacher_gender: String + Teacher_pronoun: String + Teacher_position: Int + Teacher_grade_band: String + Teacher_subjects: String + Teacher_provided_services: String + Teacher_specialized_courses: String + Teacher_state_id: String + Teacher_district: String + Teacher_school: String + Teacher_cell_phone: String + Teacher_texts_enabled: Int + Active: Int! + Teacher_date_created: date! + Teacher_date_updated: date +} + +type Classroom { + classroomId: Int! + classroom_school_id: Int + # DOUBLE-CHECK THE TYPE ON THIS + classroom_school_year: String + classroom_start_date: String + classroom_end_date: String + classroom_name: String + classroom_subject: String + classroom_display_name: String + classroom_avg_length: String + # HOW TO DEAL WITH THIS? WHICH TYPES CAN BE ENCODED INTO A JSON? + #classroom_avg_frequency int DEFAULT NULL COMMENT '1 = weekly 2 = bi-weekly 3 = monthly 4 = yearly', + classroom_avg_days: Int + classroom_grade_level_type: Int + classroom_grade_level: String + classroom_co_teacher_id: Int + classroom_teacher_idV1: Int + classroom_num_students: Int + classroom_num_seats: Int + # HOW TO DEAL WITH THIS? WHICH TYPES CAN BE ENCODED INTO A JSON? + #//classroom_student_sign_in_mode int DEFAULT NULL COMMENT '1 - Shared (QR or Google code), 2 - Single-user (email/pass).', + #//classroom_can_share_books int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + #//classroom_can_view_prompt_replies int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + #//classroom_can_view_survey_results int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + #//classroom_can_view_teacher_bookshelves int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + #//classroom_enable_family_access int DEFAULT NULL COMMENT '1 = yes, anything else is no.', + #//classroom_status_id int NOT NULL DEFAULT '0' COMMENT '0 = inactive, 1= active, 2 =archived', + classroom_status_id: Int! + classroom_conf_frequency_above: Int + classroom_conf_frequency_on: Int + classroom_conf_frequency_below: Int + classroom_conf_frequency_far_below: Int } type User { - id: ID! - first_name: String! - last_name: String! - email: String! + id: ID! + student_id: ID! + student_app_id: ID! + student_calpads_ssid: String + student_login_id: Int + first_name: String! + middle_name: String! + last_name: String! + date_created: Int + date_updated: Int + preferred_name: String + gender: Int + pronoun: Int + birth_date: String + grade_level: Int + grade_movement: Int + guided_reading_level: String + rti_srv_type: Int + student_services: String + rti_services: String + specialized_courses: String + grade_level_status: Int + lexile_level_min: Int + lexile_level_max: Int + type: Int + weakness: Int + reader_type: Int + reading_stage: Int + ethnicity: Int + avatar: String + backup_avatar: String + self_assessment: Int + reader_non_reader: Int + read_goal: Int + type_of_reading: Int + book_finish: Int + read_speed: Int + + } -type Query { - books: [Book!]! +type ReadingRateResult { + reading_rate_results_id: Int! + user_id: Int + book_id: Int + user_book_id: Int + date: String + reading_location: Int + type_of_reading: Int + reading_setting: Int + reading_type_details: Int + start_time: String + end_time: String + total_time: Int + start_page: Int + end_page: Int + total_pages: Int + word_per_page: Int + types_of_reading: String + section_rating: Int + check_in: Int + reader_request: Int + reader_request_almost_finished: Int + reader_continuum: Int + words_per_page: Int + observational_notes: String + share_feedback: Int + reader_response: String + reading_response_pages: String + reading_response_type: Int + reading_response_subtype: Int + grade_level: Int + grade_level_status: Int + teacher_id: Int } -input NewBook { - title: String! - author: String! - userId: String! +type Student { + id: ID! + studentId: ID! + studentAppId: ID! + studentCalpadsSsid: ID + studentLoginId: ID + firstName: String! + middleName: String! + lastName: String! + dateCreated: String + dateUpdated: String + preferredName: String + gender: Int + pronoun: Int + birthDate: String + gradeLevel: Int + gradeMovement: Int + guidedReadingLevel: String + rtiSrvType: Int + studentServices: String + rtiServices: String + specializedCourses: String + gradeLevelStatus: Int + lexileLevelMin: Int + lexileLevelMax: Int + type: Int + weakness: Int + readerType: Int + readingStage: Int + ethnicity: Int + avatar: String + backupAvatar: String } -type Mutation { - createBook(input: NewBook!): Book! +type Book { + id: ID! #NOT NULL AUTO_INCREMENT + story_id: ID + author: String + cover_image: String + date_created: Time #NULL DEFAULT NULL + date_updated: Time #NULL DEFAULT NULL + default_user_id: ID! #NOT NULL DEFAULT '3' + foreword: String + editor: String + illustrator: String + isbn_10: String + isbn_13: Int + num_pages: Int + # these were ints but they seem wrong - should be times imo + pub_date: Int + copyright_date: Int + # + edition: Int + synopsis: String + title: String + word_count: Int + sub_title: String + asin: String + #PRIMARY KEY (`id`) +} + +#type BookType implements Book{} + +# why are these separate? We may never know +type UserBook { + id: ID! + book_id: ID! + book_type: Int #COMMENT '1=fiction,2=non-ficiton,3=blended', + checkout_status: Int! #NOT NULL DEFAULT '4' COMMENT 'id from ''checkout_status_fields'' table.', + condition: Int + cover_image: String + date_created: Time + date_updated: Time + format: Int #COMMENT '1=hardcover,2=PaperBack,3=ebook,4=audio,5=other', + guided_reading_level: String + lexile_level: Int + location: Int + mentor_text: Int + multiple_pov: Int + price: Float + qty_label: Int + series: Int + series_name: String + series_pos: Int + tags: String + teacher_notes: String + teacher_read: Int + text_complexity: Int + unpaged: Int! + unreliable_narrative: Int + user_id: Int + entered_user_id: ID # the id of the user that entered the book into remo + want_for_classroom: Int + own_this_copy: Int! #NOT NULL DEFAULT '0' COMMENT '0=unspecified 1=user 2=school 3=School Library', + want_to_discard: Int + word_count: Int + words_per_page: Int + current_user_id: Int } + +input BookInput { + id: ID! + story_id: ID + author: String + cover_image: String + date_created: Time #NULL DEFAULT NULL + date_updated: Time #NULL DEFAULT NULL + default_user_id: ID! #NOT NULL DEFAULT '3' + foreword: String + editor: String + illustrator: String + isbn_10: String + isbn_13: Int + num_pages: Int + pub_date: Int + copyright_date: Int + edition: Int + synopsis: String + title: String + word_count: Int + sub_title: String + asin: String +} + +input NewTeacher { + id: ID! + Teacher_first_name: String! + Teacher_last_name: String! + Active: Int! + Teacher_date_created: Time! + Teacher_date_updated: Time! +} + +input NewClassroom { + classroom_id: ID! + Classroom_co_teacher_id: ID! + classroom_status_id: ID! + +} + +input NewStudent{ + id: ID! + Student_id: ID! + student_app_id: ID! + First_name: String! + Middle_name: String! + last_name: String! +} + +input newReadingRateResults{ + Reading_rate_results_id:ID! + Words_per_page: Int! +} + +# Brian said to eliminate. Will be handled elsewhere +#input NewUser { +# id: ID! +# first_name: String! +# last_name: String! +# email: String! +#} + +type Mutation { + # Book mutations + createBook(input: BookInput!): Book! + updateBook(input: BookInput): Book + + #Teacher mutations + createTeacher(input: NewTeacher!): Teacher! + + #Classroom mutations + createClassroom(input:NewClassroom!): Classroom! + + #Student mutations + createStudent(input:NewStudent!): Student! + + #ReadingRatesResults mutations + createNewReadingRateResults(input:newReadingRateResults!): ReadingRateResult! +} \ No newline at end of file diff --git a/remo-backend/graph/schema.resolvers.go b/remo-backend/graph/schema.resolvers.go index 2710bda..bca88a9 100644 --- a/remo-backend/graph/schema.resolvers.go +++ b/remo-backend/graph/schema.resolvers.go @@ -2,41 +2,478 @@ 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.22 +// Code generated by github.com/99designs/gqlgen version v0.17.24 import ( "context" + "crypto/rand" + "database/sql" + "encoding/hex" "fmt" "remo/backend/graph/model" + "strconv" ) -// Title is the resolver for the title field. -func (r *bookResolver) Title(ctx context.Context, obj *model.Book) (string, error) { - panic(fmt.Errorf("not implemented: Title - title")) +// ClassroomSchoolYear is the resolver for the classroom_school_year field. +func (r *classroomResolver) ClassroomSchoolYear(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomSchoolYear - classroom_school_year")) } -// Author is the resolver for the author field. -func (r *bookResolver) Author(ctx context.Context, obj *model.Book) (string, error) { - panic(fmt.Errorf("not implemented: Author - author")) +// ClassroomStartDate is the resolver for the classroom_start_date field. +func (r *classroomResolver) ClassroomStartDate(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomStartDate - classroom_start_date")) } -// User is the resolver for the user field. -func (r *bookResolver) User(ctx context.Context, obj *model.Book) (*model.User, error) { - panic(fmt.Errorf("not implemented: User - user")) +// ClassroomEndDate is the resolver for the classroom_end_date field. +func (r *classroomResolver) ClassroomEndDate(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomEndDate - classroom_end_date")) +} + +// ClassroomName is the resolver for the classroom_name field. +func (r *classroomResolver) ClassroomName(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomName - classroom_name")) +} + +// ClassroomSubject is the resolver for the classroom_subject field. +func (r *classroomResolver) ClassroomSubject(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomSubject - classroom_subject")) +} + +// ClassroomDisplayName is the resolver for the classroom_display_name field. +func (r *classroomResolver) ClassroomDisplayName(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomDisplayName - classroom_display_name")) +} + +// ClassroomAvgLength is the resolver for the classroom_avg_length field. +func (r *classroomResolver) ClassroomAvgLength(ctx context.Context, obj *model.Classroom) (*string, error) { + panic(fmt.Errorf("not implemented: ClassroomAvgLength - classroom_avg_length")) +} + +// ClassroomStatusID is the resolver for the classroom_status_id field. +func (r *classroomResolver) ClassroomStatusID(ctx context.Context, obj *model.Classroom) (int, error) { + panic(fmt.Errorf("not implemented: ClassroomStatusID - classroom_status_id")) } // CreateBook is the resolver for the createBook field. -func (r *mutationResolver) CreateBook(ctx context.Context, input model.NewBook) (*model.Book, error) { - panic(fmt.Errorf("not implemented: CreateBook - createBook")) +func (r *mutationResolver) CreateBook(ctx context.Context, input model.BookInput) (*model.Book, error) { + // Insert the new Book object into the database + stmt, err := DB.Prepare("INSERT INTO books (story_id, author, cover_image, date_created, date_updated, default_user_id, foreword, editor, illustrator, isbn_10, isbn_13, num_pages, pub_date, copyright_date, edition, synopsis, title, word_count, sub_title, asin) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") + if err != nil { + return nil, err + } + defer stmt.Close() + + // Execute the insert statement with the incremented ID + _, err = stmt.Exec(input.StoryID, input.Author, input.CoverImage, input.DateCreated, input.DateUpdated, input.DefaultUserID, + input.Foreword, input.Editor, input.Illustrator, input.Isbn10, input.Isbn13, input.NumPages, input.PubDate, input.CopyrightDate, + input.Edition, input.Synopsis, input.Title, input.WordCount, input.SubTitle, input.Asin) + + if err != nil { + return nil, err + } + + return &model.Book{}, err +} + +// UpdateBook is the resolver for the updateBook field. +func (r *mutationResolver) UpdateBook(ctx context.Context, input *model.BookInput) (*model.Book, error) { + //NEED TO IMPLEMENT: GET BOOK FROM DATABASE + //UPDATE QUERY + panic(fmt.Errorf("not implemented: UpdateBook - updateBook")) + //return nil, errors.New("Requested book to update was not find. Try create new book mutation") +} + +// CreateTeacher is the resolver for the createTeacher field. +func (r *mutationResolver) CreateTeacher(ctx context.Context, input model.NewTeacher) (*model.Teacher, error) { + // Insert the new Teacher object into the database + stmt, err := DB.Prepare("INSERT INTO teacher (active, teacher_date_created, teacher_date_updated, teacher_first_name, teacher_last_name) values (?, ?, ?, ?, ?)") + if err != nil { + return nil, err + } + defer stmt.Close() + + // Execute the insert statement with the incremented ID + _, err = stmt.Exec(input.Active, input.TeacherDateCreated, input.TeacherDateUpdated, + input.TeacherFirstName, input.TeacherLastName) + + if err != nil { + return nil, err + } + + return &model.Teacher{}, err } -// Books is the resolver for the books field. -func (r *queryResolver) Books(ctx context.Context) ([]*model.Book, error) { - panic(fmt.Errorf("not implemented: Books - books")) +// CreateClassroom is the resolver for the createClassroom field. +func (r *mutationResolver) CreateClassroom(ctx context.Context, input model.NewClassroom) (*model.Classroom, error) { + stmt, err := DB.Prepare("INSERT INTO classroom (classroom_co_teacher_id, classroom_status_id) values (?, ?)") + if err != nil { + return nil, err + } + defer stmt.Close() + + // Execute the insert statement with the incremented ID + _, err = stmt.Exec(input.ClassroomCoTeacherID, input.ClassroomStatusID) + + if err != nil { + return nil, err + } + + return &model.Classroom{}, err } -// Book returns BookResolver implementation. -func (r *Resolver) Book() BookResolver { return &bookResolver{r} } +// CreateStudent is the resolver for the createStudent field. +func (r *mutationResolver) CreateStudent(ctx context.Context, input model.NewStudent) (*model.Student, error) { + stmt, err := DB.Prepare("INSERT INTO student_info (student_id, student_app_id, first_name, middle_name, last_name) values (?, ?, ?, ?, ?)") + if err != nil { + return nil, err + } + defer stmt.Close() + + // Execute the insert statement with the incremented ID + _, err = stmt.Exec(input.StudentID, input.StudentAppID, input.FirstName, input.MiddleName, input.LastName) + + if err != nil { + return nil, err + } + + return &model.Student{}, err +} + +// CreateNewReadingRateResults is the resolver for the createNewReadingRateResults field. +func (r *mutationResolver) CreateNewReadingRateResults(ctx context.Context, input model.NewReadingRateResults) (*model.ReadingRateResult, error) { + stmt, err := DB.Prepare("INSERT INTO reading_rate_results (word_per_page) values (?)") + if err != nil { + return nil, err + } + defer stmt.Close() + + // Execute the insert statement with the incremented ID + _, err = stmt.Exec(input.WordsPerPage) + + if err != nil { + return nil, err + } + + return &model.ReadingRateResult{}, err +} + +// GetBookByIsbn is the resolver for the GetBookByIsbn field. +func (r *queryResolver) GetBookByIsbn(ctx context.Context, isbn int) (*model.Book, error) { + var book model.Book + + isbn13_query := DB.QueryRow(` + SELECT id, story_id, COALESCE(author, ''), COALESCE(cover_image, ''), + date_created, date_updated, default_user_id, COALESCE(foreword, ''), + COALESCE(editor, ''), COALESCE(illustrator, ''), COALESCE(isbn_10, ''), COALESCE(isbn_13, ''), + COALESCE(num_pages, 0), COALESCE(pub_date, ''), + COALESCE(copyright_date, 0), COALESCE(edition, 0), COALESCE(synopsis, ''), + COALESCE(title, ''), COALESCE(word_count, 0), COALESCE(sub_title, ''), COALESCE(asin, '') + FROM books WHERE isbn_13 = ? limit 1`, isbn) + + err1 := isbn13_query.Scan(&book.ID, + &book.Story_id, + &book.Author, + &book.Cover_image, + &book.Date_created, + &book.Date_updated, + &book.Default_user_id, + &book.Foreword, + &book.Editor, + &book.Illustrator, + &book.Isbn_10, + &book.Isbn_13, + &book.Num_pages, + &book.Pub_date, + &book.Copyright_date, + &book.Edition, + &book.Synopsis, + &book.Title, + &book.Word_count, + &book.Sub_title, + &book.Asin) + + if err1 != nil { + isbn10_query := DB.QueryRow(` + SELECT id, story_id, COALESCE(author, ''), COALESCE(cover_image, ''), date_created, date_updated, default_user_id, COALESCE(foreword, ''), + COALESCE(editor, ''), COALESCE(illustrator, ''), COALESCE(isbn_10, ''), COALESCE(isbn_13, ''), + COALESCE(num_pages, 0), COALESCE(pub_date, ''), + COALESCE(copyright_date, 0), COALESCE(edition, 0), COALESCE(synopsis, ''), + COALESCE(title, ''), COALESCE(word_count, 0), COALESCE(sub_title, ''), COALESCE(asin, '') + FROM books WHERE isbn_10 = ? limit 1`, strconv.Itoa(isbn)) + err2 := isbn10_query.Scan(&book.ID, + &book.Story_id, + &book.Author, + &book.Cover_image, + &book.Date_created, + &book.Date_updated, + &book.Default_user_id, + &book.Foreword, + &book.Editor, + &book.Illustrator, + &book.Isbn_10, + &book.Isbn_13, + &book.Num_pages, + &book.Pub_date, + &book.Copyright_date, + &book.Edition, + &book.Synopsis, + &book.Title, + &book.Word_count, + &book.Sub_title, + &book.Asin) + if err2 != nil { + var mtBook *model.Book + return mtBook, fmt.Errorf("getBookByIsbn %q: no such book", isbn) + } + } + + return &book, nil +} + +// Teachers is the resolver for the teachers field. +func (r *queryResolver) Teachers(ctx context.Context) ([]*model.Teacher, error) { + // Iterate over the results and map them to Teacher models + var teachers []*model.Teacher + + // Execute the query + rows, err := DB.Query(`SELECT + id, + COALESCE(teacher_login_id, '') AS teacher_login_id, + COALESCE(teacher_title, '') AS teacher_title, + teacher_first_name, + COALESCE(teacher_middle_name, '') AS teacher_middle_name, + teacher_last_name, + COALESCE(teacher_suffix, '') AS teacher_suffix, + COALESCE(teacher_date_of_birth, '') AS teacher_date_of_birth, + COALESCE(teacher_date_started_teaching, '') AS teacher_date_started_teaching, + COALESCE(degree_level_id, '') AS degree_level_id, + COALESCE(is_certified, '') AS is_certified, + COALESCE(certification_id, '') AS certification_id, + COALESCE(certification_start, '') AS certification_start, + COALESCE(certification_end, '') AS certification_end, + COALESCE(teacher_avatar, '') AS teacher_avatar, + COALESCE(teacher_backup_avatar, '') AS teacher_backup_avatar, + COALESCE(teacher_subscription_type, '') AS teacher_subscription_type, + COALESCE(teacher_code_name, '') AS teacher_code_name, + COALESCE(teacher_display_name, '') AS teacher_display_name, + quarantined_books, + COALESCE(teacher_backup_email, '') AS teacher_backup_email, + COALESCE(teacher_gender, '') AS teacher_gender, + COALESCE(teacher_pronoun, '') AS teacher_pronoun, + COALESCE(teacher_position, '') AS teacher_position, + COALESCE(teacher_grade_band, '') AS teacher_grade_band, + COALESCE(teacher_subjects, '') AS teacher_subjects, + COALESCE(teacher_provided_services, '') AS teacher_provided_services, + COALESCE(teacher_specialized_courses, '') AS teacher_specialized_courses, + COALESCE(teacher_state_id, '') AS teacher_state_id, + COALESCE(teacher_district, '') AS teacher_district, + COALESCE(teacher_school, '') AS teacher_school, + COALESCE(teacher_cell_phone, '') AS teacher_cell_phone, + COALESCE(teacher_texts_enabled, '') AS teacher_texts_enabled, + active, + teacher_date_created, + teacher_date_updated + FROM teacher`) + if err != nil { + return nil, err + } + var laterAssignment []uint8 + defer rows.Close() + for rows.Next() { + teacher := &model.Teacher{} + err := rows.Scan( + &teacher.Teacher_id, + &teacher.Teacher_login_id, + &teacher.Teacher_title, + &teacher.Teacher_first_name, + &teacher.Teacher_middle_name, + &teacher.Teacher_last_name, + &teacher.Teacher_suffix, + &laterAssignment, + //&teacher.Teacher_date_of_birth, + &teacher.Teacher_date_started_teaching, + &teacher.Degree_level_id, + &teacher.Is_certified, + &teacher.Certification_id, + &teacher.Certification_start, + &teacher.Certification_end, + &teacher.Teacher_avatar, + &teacher.Teacher_backup_avater, + &teacher.Teacher_subscription_type, + &teacher.Teacher_code_name, + &teacher.Teacher_display_name, + &teacher.Quarantined_books, + &teacher.Teacher_backup_email, + &teacher.Teacher_gender, + &teacher.Teacher_pronoun, + &teacher.Teacher_position, + &teacher.Teacher_grade_band, + &teacher.Teacher_subjects, + &teacher.Teacher_provided_services, + &teacher.Teacher_specialized_courses, + &teacher.Teacher_state_id, + &teacher.Teacher_district, + &teacher.Teacher_school, + &teacher.Teacher_cell_phone, + &teacher.Teacher_texts_enabled, + &teacher.Active, + &teacher.Teacher_date_created, + &teacher.Teacher_date_updated, + ) + if err != nil { + return nil, err + } + + fmt.Print(laterAssignment) + + // strconv.FormatUint(laterAssignment, 10) + // time.Parse("2006-Jan-02", laterAssignment) + // teacher.Teacher_date_of_birth = laterAssignment + + teachers = append(teachers, teacher) + } + + return teachers, nil +} + +// GetUserByID is the resolver for the getUserByID field. +func (r *queryResolver) GetUserByID(ctx context.Context, id string) (*model.User, error) { + var user model.User + + row := DB.QueryRow(`SELECT + COALESCE(id,'0'), + COALESCE(student_id,'0'), + COALESCE(student_app_id,'0'), + COALESCE(student_calpads_ssid,'0'), + COALESCE(student_login_id,'0'), + COALESCE(first_name,''), + COALESCE(middle_name,''), + COALESCE(last_name,''), + COALESCE(date_created,0), + COALESCE(date_updated,0), + COALESCE(preferred_name,''), + COALESCE(gender,0), + COALESCE(pronoun,0), + COALESCE(birth_date,''), + COALESCE(grade_level,0), + COALESCE(grade_movement,0), + COALESCE(guided_reading_level,'0'), + COALESCE(rti_srv_type,0), + COALESCE(student_services,''), + COALESCE(rti_services,''), + COALESCE(specialized_courses,''), + COALESCE(grade_level_status,0), + COALESCE(lexile_level_min,0), + COALESCE(lexile_level_max,0), + COALESCE(type,0), + COALESCE(weakness,0), + COALESCE(reader_type,0), + COALESCE(reading_stage,0), + COALESCE(ethnicity,0), + COALESCE(avatar,''), + COALESCE(backup_avatar,'') FROM student_info WHERE id = ?`, id) + + //COALESCE(self_assessment,0), COALESCE(reader_non_reader,0), COALESCE(read_goal,0), + // COALESCE(type_of_reading,0), COALESCE(book_finish,0), COALESCE(read_speed,0) + + if err := row.Scan(&user.ID, + &user.StudentID, + &user.StudentAppID, + &user.StudentCalpadsSsid, + &user.StudentLoginID, + &user.FirstName, + &user.MiddleName, + &user.LastName, + &user.DateCreated, + &user.DateUpdated, + &user.PreferredName, + &user.Gender, + &user.Pronoun, + &user.BirthDate, + &user.GradeLevel, + &user.GradeMovement, + &user.GuidedReadingLevel, + &user.RtiSrvType, + &user.StudentServices, + &user.RtiServices, + &user.SpecializedCourses, + &user.GradeLevelStatus, + &user.LexileLevelMin, + &user.LexileLevelMax, + &user.Type, + &user.Weakness, + &user.ReaderType, + &user.ReadingStage, + &user.Ethnicity, + &user.Avatar, + &user.BackupAvatar); err != nil { + if err == sql.ErrNoRows { + var mtUser *model.User + return mtUser, fmt.Errorf("GetUserByID %q: no such user", id) + } + + return &user, fmt.Errorf("GetUserByID %q: %v", id, err) + } + return &user, nil +} + +// Date is the resolver for the date field. +func (r *readingRateResultResolver) Date(ctx context.Context, obj *model.ReadingRateResult) (*string, error) { + panic(fmt.Errorf("not implemented: Date - date")) +} + +// StartTime is the resolver for the start_time field. +func (r *readingRateResultResolver) StartTime(ctx context.Context, obj *model.ReadingRateResult) (*string, error) { + panic(fmt.Errorf("not implemented: StartTime - start_time")) +} + +// EndTime is the resolver for the end_time field. +func (r *readingRateResultResolver) EndTime(ctx context.Context, obj *model.ReadingRateResult) (*string, error) { + panic(fmt.Errorf("not implemented: EndTime - end_time")) +} + +// DateCreated is the resolver for the dateCreated field. +func (r *studentResolver) DateCreated(ctx context.Context, obj *model.Student) (*string, error) { + panic(fmt.Errorf("not implemented: DateCreated - dateCreated")) +} + +// DateUpdated is the resolver for the dateUpdated field. +func (r *studentResolver) DateUpdated(ctx context.Context, obj *model.Student) (*string, error) { + panic(fmt.Errorf("not implemented: DateUpdated - dateUpdated")) +} + +// RtiSrvType is the resolver for the rtiSrvType field. +func (r *studentResolver) RtiSrvType(ctx context.Context, obj *model.Student) (*int, error) { + panic(fmt.Errorf("not implemented: RtiSrvType - rtiSrvType")) +} + +// TeacherDateOfBirth is the resolver for the Teacher_date_of_birth field. +func (r *teacherResolver) TeacherDateOfBirth(ctx context.Context, obj *model.Teacher) (*string, error) { + panic(fmt.Errorf("not implemented: TeacherDateOfBirth - Teacher_date_of_birth")) +} + +// Active is the resolver for the Active field. +func (r *teacherResolver) Active(ctx context.Context, obj *model.Teacher) (int, error) { + panic(fmt.Errorf("not implemented: Active - Active")) +} + +// TeacherDateCreated is the resolver for the Teacher_date_created field. +func (r *teacherResolver) TeacherDateCreated(ctx context.Context, obj *model.Teacher) (string, error) { + panic(fmt.Errorf("not implemented: TeacherDateCreated - Teacher_date_created")) +} + +// TeacherDateUpdated is the resolver for the Teacher_date_updated field. +func (r *teacherResolver) TeacherDateUpdated(ctx context.Context, obj *model.Teacher) (*string, error) { + panic(fmt.Errorf("not implemented: TeacherDateUpdated - Teacher_date_updated")) +} + +// QtyLabel is the resolver for the qty_label field. +func (r *userBookResolver) QtyLabel(ctx context.Context, obj *model.UserBook) (*int, error) { + panic(fmt.Errorf("not implemented: QtyLabel - qty_label")) +} + +// Classroom returns ClassroomResolver implementation. +func (r *Resolver) Classroom() ClassroomResolver { return &classroomResolver{r} } // Mutation returns MutationResolver implementation. func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } @@ -44,6 +481,96 @@ func (r *Resolver) Mutation() MutationResolver { return &mutationResolver{r} } // Query returns QueryResolver implementation. func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } -type bookResolver struct{ *Resolver } +// ReadingRateResult returns ReadingRateResultResolver implementation. +func (r *Resolver) ReadingRateResult() ReadingRateResultResolver { + return &readingRateResultResolver{r} +} + +// Student returns StudentResolver implementation. +func (r *Resolver) Student() StudentResolver { return &studentResolver{r} } + +// Teacher returns TeacherResolver implementation. +func (r *Resolver) Teacher() TeacherResolver { return &teacherResolver{r} } + +// UserBook returns UserBookResolver implementation. +func (r *Resolver) UserBook() UserBookResolver { return &userBookResolver{r} } + +type classroomResolver struct{ *Resolver } type mutationResolver struct{ *Resolver } type queryResolver struct{ *Resolver } +type readingRateResultResolver struct{ *Resolver } +type studentResolver struct{ *Resolver } +type teacherResolver struct{ *Resolver } +type userBookResolver struct{ *Resolver } + +// !!! WARNING !!! +// The code below was going to be deleted when updating resolvers. It has been copied here so you have +// one last chance to move it out of harms way if you want. There are two reasons this happens: +// - When renaming or deleting a resolver the old code will be put in here. You can safely delete +// it when you're done. +// - You have helper methods in this file. Move them out to keep these resolver files clean. +func (r *teacherResolver) TeacherDateStartedTeaching(ctx context.Context, obj *model.Teacher) (*string, error) { + panic(fmt.Errorf("not implemented: TeacherDateStartedTeaching - Teacher_date_started_teaching")) +} +func (r *teacherResolver) TestField(ctx context.Context, obj *model.Teacher) (string, error) { + panic(fmt.Errorf("not implemented: TestField - test_field")) +} + +type MsModel struct { + Conn *sql.DB +} + +func (r *queryResolver) GetBookByID(ctx context.Context, id string) (*model.Book, error) { + var book model.Book + + row := DB.QueryRow(` + SELECT id, story_id, COALESCE(author, ''), COALESCE(cover_image, ''), + date_created, date_updated, default_user_id, COALESCE(foreword, ''), + COALESCE(editor, ''), COALESCE(illustrator, ''), COALESCE(isbn_10, ''), COALESCE(isbn_13, ''), + COALESCE(num_pages, 0), COALESCE(pub_date, ''), + COALESCE(copyright_date, 0), COALESCE(edition, 0), COALESCE(synopsis, ''), + COALESCE(title, ''), COALESCE(word_count, 0), COALESCE(sub_title, ''), COALESCE(asin, '') + FROM books WHERE isbn_13 = ?`, id) + + if err := row.Scan(&book.ID, + &book.Story_id, + &book.Author, + &book.Cover_image, + &book.Date_created, + &book.Date_updated, + &book.Default_user_id, + &book.Foreword, + &book.Editor, + &book.Illustrator, + &book.Isbn_10, + &book.Isbn_13, + &book.Num_pages, + &book.Pub_date, + &book.Copyright_date, + &book.Edition, + &book.Synopsis, + &book.Title, + &book.Word_count, + &book.Sub_title, + &book.Asin); err != nil { + if err == sql.ErrNoRows { + var mtBook *model.Book + return mtBook, fmt.Errorf("getBookByID %q: no such book", id) + } + + return &book, fmt.Errorf("getBookByID %q: %v", id, err) + } + + return &book, nil +} + +var DB, err = DbInitConnection() + +func generateID() (string, error) { + id := make([]byte, 16) + _, err := rand.Read(id) + if err != nil { + return "", err + } + return hex.EncodeToString(id), nil +} diff --git a/remo-backend/server.go b/remo-backend/server.go index b88b260..c13c419 100644 --- a/remo-backend/server.go +++ b/remo-backend/server.go @@ -1,28 +1,45 @@ -package main +package server + +//package main import ( - "log" - "net/http" - "os" "remo/backend/graph" + "github.com/gin-gonic/gin" + "github.com/99designs/gqlgen/graphql/handler" "github.com/99designs/gqlgen/graphql/playground" ) -const defaultPort = "8080" +// Defining the Graphql handler +func GraphqlHandler() gin.HandlerFunc { + // NewExecutableSchema and Config are in the generated.go file + // Resolver is in the resolver.go file + h := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{}})) -func main() { - port := os.Getenv("PORT") - if port == "" { - port = defaultPort + return func(c *gin.Context) { + h.ServeHTTP(c.Writer, c.Request) } +} - srv := handler.NewDefaultServer(graph.NewExecutableSchema(graph.Config{Resolvers: &graph.Resolver{}})) - - http.Handle("/", playground.Handler("GraphQL playground", "/query")) - http.Handle("/query", srv) +// Defining the Playground handler +func PlaygroundHandler() gin.HandlerFunc { + h := playground.Handler("GraphQL", "/v1/query") - log.Printf("connect to http://localhost:%s/ for GraphQL playground", port) - log.Fatal(http.ListenAndServe(":"+port, nil)) + return func(c *gin.Context) { + h.ServeHTTP(c.Writer, c.Request) + } } + +// func InitServer() { +// // Setting up Gin +// //Migrate Db +// db := model.FetchConnection() +// db.AutoMigrate(&model.Book{}) +// defer db.Close() + +// r := gin.Default() +// r.POST("/query", GraphqlHandler()) +// r.GET("/", playgroundHandler()) +// r.Run() +// } diff --git a/remo-backend/src/controller/controller.go b/remo-backend/src/controller/controller.go new file mode 100644 index 0000000..be01772 --- /dev/null +++ b/remo-backend/src/controller/controller.go @@ -0,0 +1,248 @@ +package controller + +import ( + "fmt" + "net/http" + "os" + server "remo/backend" + "remo/backend/graph" + "remo/backend/src/middleware" + "remo/backend/src/model" + "strconv" + + "github.com/dgrijalva/jwt-go" + "github.com/gin-gonic/gin" +) + +// GLOBAL VARIABLES FOR RESOLVER INIT +var qResolver graph.QueryResolver +var mResolver graph.MutationResolver + +func getUserByIDHandler(r *graph.QueryResolver) gin.HandlerFunc { + + return func(c *gin.Context) { + id := c.Param("userID") + user, err := (*r).GetUserByID(c, id) + if err != nil { + c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return + } + c.JSON(http.StatusOK, user) + } +} + +type Controller interface { + Serve() *gin.Engine +} + +type MsController struct { + model.Model +} + +func (ms *MsController) Serve() *gin.Engine { + r := gin.Default() + + r.POST("/v1/register", func(c *gin.Context) { + var user model.User + + if err := c.BindJSON(&user); err != nil { + c.JSON(http.StatusBadRequest, "Failed to unmarshal user") + return + } + + _, err := ms.AddUser(user) + + if err != nil { + c.JSON(http.StatusBadRequest, "Failed to add a user") + panic(err) + } + + c.JSON(http.StatusOK, user.ID) + }) + + // r.GET("/v1/user/:id", func(c *gin.Context) { + // id := c.Param("id") + // c.JSON(http.StatusOK, ms.UserByID(id)) + + // }) + + r.POST("v1/login", func(c *gin.Context) { + + var loginInfo model.LoginInfo + + // check for invalid JSON bindings and rasie an error if true + if err := c.ShouldBindJSON(&loginInfo); err != nil { + err := middleware.NewBadRequestError("invalid_json_body") + c.JSON(err.Status, err) + return + } + + token, _ := jwt.Parse(loginInfo.Credential, nil) + + // extract the claims + claims, ok := token.Claims.(jwt.MapClaims) + if !ok { + fmt.Print("INVALID GMAIL") + return + } + + if email, ok := claims["email"].(string); ok { + loginInfo.Email = email + check_usr, err := ms.UserByEmail(email) + if err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"error": "Something went wrong completing your sign in."}) + return + } + loginInfo.ID = strconv.Itoa(check_usr.ID) + } + + if first, ok := claims["given_name"].(string); ok { + loginInfo.FirstName = first + } + + if last, ok := claims["family_name"].(string); ok { + loginInfo.LastName = last + } + + if pic, ok := claims["picture"].(string); ok { + loginInfo.Picture = pic + } + + fmt.Println(loginInfo) + + // create a JWT for the app and send it back to the client for future requests + tokenString, err := middleware.MakeJWT(loginInfo, "secretkey") + if err != nil { + middleware.NewBadRequestError("Failed to create JWT") + c.JSON(http.StatusInternalServerError, gin.H{"error": "Something went wrong completing your sign in."}) + return + } + + message := tokenString + c.JSON(http.StatusOK, message) + + println("AUTHENTICATED", message) + }) + + r.GET("/logout", func(c *gin.Context) { + println("Google logout") + c.SetCookie("remo_jwt", "", -1, "", "", false, true) + c.JSON(http.StatusOK, gin.H{ + "message": "success", + }) + }) + + // THE MASTER QUERY ENDPOINT + r.POST("/v1/query", server.GraphqlHandler()) + + // THE HOLY PLAYGROUND + r.GET("/", server.PlaygroundHandler()) + + r.GET("/v1/all_books", func(c *gin.Context) { + c.JSON(http.StatusOK, ms.AllBooks()) + }) + + r.GET("/v1/user/:id", func(c *gin.Context) { + id := c.Param("id") + user, err := qResolver.GetUserByID(c, id) + if err != nil { + c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) + return + } + c.JSON(http.StatusOK, user) + }) + + r.PUT("v1/checkout_book/:bookId/:userId", func(c *gin.Context) { + isbn_13 := c.Param("bookId") + user_id := c.Param("userId") + + err := ms.CheckoutBook(user_id, isbn_13) + + if err != nil { + c.JSON(http.StatusBadRequest, "Failed to checkout book") + panic(err) + } + + c.JSON(http.StatusOK, isbn_13) + + }) + + r.PUT("v1/return/:bookId", func(c *gin.Context) { + isbn_13 := c.Param("bookId") + fmt.Println(isbn_13) + + err := ms.ReturnBookByID(isbn_13) + + if err != nil { + c.JSON(http.StatusBadRequest, "Failed to return book") + panic(err) + } + + c.JSON(http.StatusOK, isbn_13) + }) + + // DELETE BELOW + + // r.POST("/v1/addBook", func(c *gin.Context) { + // var book model.Book + + // if err := c.BindJSON(&book); err != nil { + // c.JSON(http.StatusBadRequest, "Failed to unmarshal book") + // return + // } + + // _, err := ms.AddBooks(book) + + // if err != nil { + // c.JSON(http.StatusBadRequest, "Failed to add a book") + // panic(err) + // } + + // c.JSON(http.StatusOK, book.BookId) + // }) + + r.POST("/v1/onboarding_questions/:user_Id", func(c *gin.Context) { + var questions model.OnboardingQuestions + user_id := c.Param("user_Id") + + if err := c.BindJSON(&questions); err != nil { + c.JSON(http.StatusBadRequest, "Failed to unmarshal questions") + return + } + + err := ms.AddOnboardingQuestions(user_id, questions) + + if err != nil { + c.JSON(http.StatusBadRequest, "Failed to register questions") + panic(err) + } + + c.JSON(http.StatusOK, "success") + }) + + r.GET("/v1/check_onboarded/:user_Id", func(c *gin.Context) { + user_id := c.Param("user_Id") + + check, err := ms.CheckOnboarded(user_id) + + if check != "onboarded" { + c.JSON(http.StatusBadRequest, "Failed to check onboarded user") + panic(err) + } + + c.JSON(http.StatusOK, "onboarded") + }) + + //protected endpoint group (uses middelware below) + protected := r.Group("/protected") + //sets up middleware for this protected endpoint + protected.Use(middleware.JwtAuthMiddleware()) + protected.GET("/hi", ProtectedEndpointTest) + return r +} + +var SecretKey string = os.Getenv("secretKey") + +func ProtectedEndpointTest(c *gin.Context) { + println("entered protected endpoint with remo jwt") +} diff --git a/remo-backend/src/controller/users/user_controller.go b/remo-backend/src/controller/users/user_controller.go deleted file mode 100644 index 617ffd7..0000000 --- a/remo-backend/src/controller/users/user_controller.go +++ /dev/null @@ -1,114 +0,0 @@ -package users - -import ( - "net/http" - "remo/backend/src/domain/users" - "remo/backend/src/services" - errors "remo/backend/src/utils" - "strconv" - "time" - - "github.com/dgrijalva/jwt-go" - "github.com/gin-gonic/gin" -) - -// holds the DB secret key -const SecretKey = "abcdefghijklmnopqrstuvwxy" - -// Registers a new user into the MySQL database using the CreateUser service -func Register(c *gin.Context) { - var user users.User - - // check for invalid JSON bindings and rasie an error if true - if err := c.ShouldBindJSON(&user); err != nil { - err := errors.NewBadRequestError("invalid_json_body") - c.JSON(err.Status, err) - return - } - - // create the new user with the CreateUser service - result, saveErr := services.CreateUser(user) - - // raise a save error if one occurs - if saveErr != nil { - c.JSON(saveErr.Status, saveErr) - return - } - - // set the context JSON to the new user - c.JSON(http.StatusOK, result) -} - -// Logs in an existing user to the backend -func Login(c *gin.Context) { - var user users.User - - if err := c.ShouldBindJSON(&user); err != nil { - err := errors.NewBadRequestError("invalid json") - c.JSON(err.Status, err) - return - } - - result, getErr := services.GetUser(user) - if getErr != nil { - c.JSON(getErr.Status, getErr) - return - } - - claims := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.StandardClaims{ - Issuer: strconv.Itoa(int(result.ID)), - ExpiresAt: time.Now().Add(time.Hour * 72).Unix(), - }) - - token, err := claims.SignedString([]byte(SecretKey)) - if err != nil { - err := errors.NewInternalServerError("login failed") - c.JSON(err.Status, err) - return - } - - c.SetCookie("jwt", token, 3213, "/", "localhost", false, true) - - c.JSON(http.StatusOK, result) -} - -func Get(c *gin.Context) { - cookie, err := c.Cookie("jwt") - if err != nil { - getErr := errors.NewInternalServerError("could not retrieve cookie") - c.JSON(getErr.Status, getErr) - return - } - - token, err := jwt.ParseWithClaims(cookie, &jwt.StandardClaims{}, func(*jwt.Token) (interface{}, error) { - return []byte(SecretKey), nil - }) - if err != nil { - restErr := errors.NewInternalServerError("error parsing cookie") - c.JSON(restErr.Status, restErr) - return - } - - claims := token.Claims.(*jwt.StandardClaims) - issuer, err := strconv.ParseInt(claims.Issuer, 10, 64) - if err != nil { - restErr := errors.NewBadRequestError("user id should be a number") - c.JSON(restErr.Status, restErr) - return - } - - result, restErr := services.GetUserByID(issuer) - if restErr != nil { - c.JSON(restErr.Status, restErr) - return - } - - c.JSON(http.StatusOK, result) -} - -func Logout(c *gin.Context) { - c.SetCookie("jwt", "", -1, "", "", false, true) - c.JSON(http.StatusOK, gin.H{ - "message": "success", - }) -} diff --git a/remo-backend/src/datasource/mysql/remo_db/remo_db.go b/remo-backend/src/datasource/mysql/remo_db/remo_db.go deleted file mode 100644 index cb09ba3..0000000 --- a/remo-backend/src/datasource/mysql/remo_db/remo_db.go +++ /dev/null @@ -1,34 +0,0 @@ -package remodb - -import ( - "database/sql" - "fmt" - "log" - - _ "github.com/go-sql-driver/mysql" -) - -var ( - Client *sql.DB - username = "remo" - password = "pwd" - host = "127.0.0.1:3213" - schema = "remodb" -) - -func init() { - // usernames and passwords - dataSourceName := fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8", username, password, host, schema) - - var err error - Client, err = sql.Open("mysql", dataSourceName) - if err != nil { - panic(err) - } - - if err := Client.Ping(); err != nil { - panic(err) - } - - log.Println("db_configured") -} diff --git a/remo-backend/src/domain/users/users_dao.go b/remo-backend/src/domain/users/users_dao.go deleted file mode 100644 index 6934c59..0000000 --- a/remo-backend/src/domain/users/users_dao.go +++ /dev/null @@ -1,63 +0,0 @@ -package users - -import ( - "fmt" - remodb "remo/backend/src/datasource/mysql/remo_db" - errors "remo/backend/src/utils" -) - -var ( - queryInsertUser = "INSERT INTO users (first_name, last_name, email, password) VALUES (?, ?, ?, ?);" - queryGetUserByEmail = "SELECT id, first_name, last_name, email, password FROM users WHERE email=?;" - queryGetUserByID = "SELECT id, first_name, last_name, email FROM users WHERE id=?;" -) - -func (user *User) Save() *errors.RestErr { - stmt, err := remodb.Client.Prepare(queryInsertUser) - if err != nil { - return errors.NewInternalServerError("database error") - } - defer stmt.Close() - - insertResult, saveErr := stmt.Exec(user.FirstName, user.LastName, user.Email, user.Password) - if saveErr != nil { - fmt.Println(saveErr) - return errors.NewInternalServerError("database error") - } - - userID, err := insertResult.LastInsertId() - if err != nil { - return errors.NewInternalServerError("database error") - } - user.ID = userID - return nil -} - -func (user *User) GetByEmail() *errors.RestErr { - stmt, err := remodb.Client.Prepare(queryGetUserByEmail) - if err != nil { - return errors.NewInternalServerError("invalid email") - } - defer stmt.Close() - - result := stmt.QueryRow(user.Email) - if getErr := result.Scan(&user.ID, &user.FirstName, &user.LastName, &user.Email, &user.Password); getErr != nil { - fmt.Println(getErr) - return errors.NewInternalServerError("database error") - } - return nil -} - -func (user *User) GetByID() *errors.RestErr { - stmt, err := remodb.Client.Prepare(queryGetUserByID) - if err != nil { - return errors.NewInternalServerError("database error") - } - defer stmt.Close() - - result := stmt.QueryRow(user.ID) - if getErr := result.Scan(&user.ID, &user.FirstName, &user.LastName, &user.Email); getErr != nil { - return errors.NewInternalServerError("database error") - } - return nil -} diff --git a/remo-backend/src/domain/users/users_dto.go b/remo-backend/src/domain/users/users_dto.go deleted file mode 100644 index 76b0bb0..0000000 --- a/remo-backend/src/domain/users/users_dto.go +++ /dev/null @@ -1,29 +0,0 @@ -package users - -import ( - errors "remo/backend/src/utils" - "strings" -) - -type User struct { - ID int64 `json:"ID"` - FirstName string `json:"first_name"` - LastName string `json:"last_name"` - Password string `json:"password"` - Email string `json:"email"` -} - -func (user *User) Validate() *errors.RestErr { - user.FirstName = strings.TrimSpace(user.FirstName) - user.LastName = strings.TrimSpace(user.LastName) - user.Email = strings.TrimSpace(user.Email) - if user.Email == "" { - return errors.NewBadRequestError("invalid email address") - } - - user.Password = strings.TrimSpace(user.Password) - if user.Password == "" { - return errors.NewBadRequestError("invalid password") - } - return nil -} diff --git a/remo-backend/src/endpoints/endpoints.go b/remo-backend/src/endpoints/endpoints.go deleted file mode 100644 index c67d3d1..0000000 --- a/remo-backend/src/endpoints/endpoints.go +++ /dev/null @@ -1,30 +0,0 @@ -package endpoints - -import ( - "remo/backend/src/controller/users" - - "github.com/gin-gonic/gin" -) - -// func books() []t.Book { -// return []t.Book{ -// {BookId: "1", Title: "test", Author: "test-author"}, -// } -// } - -// // getAlbums responds with the list of all albums as JSON. -// func getBooks(c *gin.Context) { -// c.JSON(http.StatusOK, books()) -// } - -// Everything above here is going to move to a folder (controller layer) -func Serve() *gin.Engine { - r := gin.Default() - // r.GET("/v1/books", getBooks) - go r.POST("/v1/register", users.Register) - go r.POST("v1/login", users.Login) - go r.GET("v1/user", users.Get) - go r.GET("v1/logout", users.Logout) - - return r -} diff --git a/remo-backend/src/endpoints/endpoints_test.go b/remo-backend/src/endpoints/endpoints_test.go deleted file mode 100644 index e93ee4f..0000000 --- a/remo-backend/src/endpoints/endpoints_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package endpoints - -import ( - "testing" -) - -func TestBooks(t *testing.T) { - // b := books() - - // assert.Equal(t, []types.Book{ - // { - // BookId: "1", - // Title: "test", - // Author: "test-author", - // }, - // }, b) -} diff --git a/remo-backend/src/main.go b/remo-backend/src/main.go index 40dbf28..7590b63 100644 --- a/remo-backend/src/main.go +++ b/remo-backend/src/main.go @@ -1,10 +1,33 @@ package main import ( - e "remo/backend/src/endpoints" + "database/sql" + "fmt" + "os" + c "remo/backend/src/controller" + "remo/backend/src/model" + + _ "github.com/go-sql-driver/mysql" ) func main() { + conn, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") + + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + os.Exit(1) + } + + defer conn.Close() + + m := &model.MsModel{ + Conn: conn, + } + c := &c.MsController{ + Model: m, + } + c.Serve().Run(":8080") - e.Serve().Run(":8080") + // literally just added a line calling main function of server.go + //server.InitServer() } diff --git a/remo-backend/src/middleware/jwt_handlers.go b/remo-backend/src/middleware/jwt_handlers.go new file mode 100644 index 0000000..e841b0c --- /dev/null +++ b/remo-backend/src/middleware/jwt_handlers.go @@ -0,0 +1,48 @@ +package middleware + +import ( + "fmt" + + "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v4" +) + +// middleware for protected endpoints +func JwtAuthMiddleware() gin.HandlerFunc { + return func(c *gin.Context) { + cookie, err := c.Cookie("remo_jwt") + if err != nil { + err := NewBadRequestError("token not found") + c.JSON(err.Status, err) + } + if DecodeJWT(cookie, "secretkey") != nil { + err := NewBadRequestError("invalid_json_body") + c.JSON(err.Status, err) + } + println("JWT TOKEN VALID") + c.Next() + } +} + +// Decode JWT for middleware validation +func DecodeJWT(tokenStr string, secretStr string) error { + mySigningKey := []byte(secretStr) + // claims := jwt.RegisteredClaims{} + token, err := jwt.ParseWithClaims(tokenStr, &jwt.RegisteredClaims{}, func(token *jwt.Token) (interface{}, error) { + return mySigningKey, nil + }) + + if err != nil { + fmt.Println("ERROR parsing token", err) + fmt.Println("Token provided", tokenStr) + return err + } + + if token.Valid { + println("VALID TOKEN:" + token.Raw) + } + + //can do extra validation in this function depending on user types and stuff. + + return nil +} diff --git a/remo-backend/src/middleware/make_cookie.go b/remo-backend/src/middleware/make_cookie.go new file mode 100644 index 0000000..f7cdb2d --- /dev/null +++ b/remo-backend/src/middleware/make_cookie.go @@ -0,0 +1,51 @@ +package middleware + +import ( + "remo/backend/src/model" + + "github.com/golang-jwt/jwt/v4" +) + +// type LoginInfo struct { +// Credential string `json:"credential"` +// Email string `json:"email"` +// FirstName string `json:"first_name"` +// LastName string `json:"last_name"` +// Picture string `json:"picture"` +// } + +func MakeJWT(loginInfo model.LoginInfo, secret string) (tokenString string, err error) { + + //example of making a token with specific details: + // claims := jwt.MapClaims{} + // claims["subject"] = subject + // claims["authorized"] = true + // // claims["audience"] = audience + // token := jwt.NewWithClaims(jwt.SigningMethodRS256, claims) + + mySigningKey := []byte("secret") + + // Create the Claims + claims := &jwt.MapClaims{ + "Email": loginInfo.Email, + "FirstName": loginInfo.FirstName, + "LastName": loginInfo.LastName, + "Credential": loginInfo.Credential, + "Picture": loginInfo.Picture, + "ID": loginInfo.ID, + + // "iss": "issuer", + // "exp": time.Now().Add(time.Hour).Unix(), + // "data": map[string]string{ + // "id": "123", + // "name": "JohnDoe", + // }, + } + + //can use any signing encryption algorithm, this is with HS256, other option could be RS256 + token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + signedToken, err := token.SignedString(mySigningKey) + + println("signedJWTToken:" + signedToken) + return signedToken, err +} diff --git a/remo-backend/src/utils/rest_error.go b/remo-backend/src/middleware/rest_error.go similarity index 95% rename from remo-backend/src/utils/rest_error.go rename to remo-backend/src/middleware/rest_error.go index a994819..ee77b05 100644 --- a/remo-backend/src/utils/rest_error.go +++ b/remo-backend/src/middleware/rest_error.go @@ -1,4 +1,4 @@ -package errors +package middleware import "net/http" diff --git a/remo-backend/src/migrations/remo_staging.sql b/remo-backend/src/migrations/remo_staging.sql index 4561fed..2a53862 100644 --- a/remo-backend/src/migrations/remo_staging.sql +++ b/remo-backend/src/migrations/remo_staging.sql @@ -1,11 +1,10 @@ --- phpMyAdmin SQL Dump --- version 5.2.0 --- https://www.phpmyadmin.net/ --- --- Host: localhost --- Generation Time: Jan 11, 2023 at 06:31 PM --- Server version: 5.5.68-MariaDB --- PHP Version: 7.4.25 +DROP DATABASE IF EXISTS `remodb`; +CREATE DATABASE `remodb`; +USE `remodb`; + +GRANT ALL PRIVILEGES ON remodb.* TO 'remo'@'%'; + +FLUSH PRIVILEGES; SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; @@ -17,15 +16,6 @@ SET time_zone = "+00:00"; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; --- --- Database: `remo_staging` --- - --- -------------------------------------------------------- - --- --- Table structure for table `assessment_types` --- CREATE TABLE `assessment_types` ( `assessment_type_id` int(11) NOT NULL, @@ -34,6 +24,20 @@ CREATE TABLE `assessment_types` ( `sort` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `onboarding_questions` ( + `user_id` varchar(50) NOT NULL, + `q1` varchar(250), + `q2` varchar(250), + `q3` varchar(250), + `q4` varchar(250), + `q5` varchar(250), + `q6` varchar(250), + `q7` varchar(250), + `q8` varchar(250), + `onboarded` varchar(10) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + + -- -- Dumping data for table `assessment_types` -- @@ -3240,14 +3244,14 @@ INSERT INTO `books` (`id`, `story_id`, `author`, `cover_image`, `date_created`, (27, 27, 'Jake Parker, Chrystin Garland, Jason Caffoe, Dave Roman, Raina Telgemeier, Michel Gagne, Katie Shanahan, Kazu Kibuishi, Steven Shanahan, ', NULL, '2020-01-10 21:26:54', '2021-09-04 22:58:40', 3, '', 'Kazu Kibuishi', 'Jake Parker, Chrystin Garland, Jason Caffoe, Dave Roman, Raina Telgemeier, Michel Gagne, Katie Shanahan, Kazu Kibuishi, Steven Shanahan', '1419708813', 9781419708817, 128, 2013, 2013, 0, 'The Lost Islands is a collection of seven all-new stories with each story centered around the theme of hidden places. ', 'The Lost Islands', 0, 'The Lost Islands', '0'), (28, 28, 'Emily Carroll, Dave Roman, Raina Telgemeier, Jason Caffoe, Rad Sechrist, Stuart Livingston, Johane Matte, Kazu Kibuishi', NULL, '2020-01-10 21:39:58', '2021-09-22 00:59:09', 3, '', 'Kazu Kibuishi', 'Emily Carroll, Dave Roman, Raina Telgemeier, Jason Caffoe, Rad Sechrist, Stuart Livingston, Johane Matte, Kazu Kibuishi', '1419700103', 9781419700101, 126, 2012, 2013, 1, 'Seven clever stories answer one simple question: what’s in the box?\r\n\r\nFunny, fantastic, spooky, and suspenseful, each of these unique and beautifully illustrated short graphic works revolves around a central theme: a mysterious box and the marvels—or mayhem—inside. ', 'Explorer', 0, '', '0'), (29, 29, 'Chris Bunch', NULL, '2020-01-10 23:47:17', '2020-02-18 04:23:38', 795, '', '', '', '1440553629', 9781440553622, 100, 2012, NULL, NULL, 'The human Confederation empire stretches across the endless night between the stars, slowly rotting from within even as it faces threats from without. And at its farthest reaches stand the forgotten men and women of the Last Legion - all that stands between the empire and chaos. As violence between factions escalates and the Legion strives to keep the peace, a planet on the edge of nowhere will set the stage for the empire’s final stand . . .', 'The Last Legion', 250500, NULL, NULL), -(30, 30, 'Deanna F. Cook', NULL, '2020-01-11 21:57:50', '2020-01-11 21:57:50', 3, '', '', '', '1635862302', 9781635862300, 144, 2019, NULL, NULL, 'Food is a fun way to celebrate diversity, and in her new kids’ cookbook, best-selling author Deanna F. Cook leads young chefs on a tasty tour of global cultures and cuisines. Kids gain practical kitchen skills through preparing breakfasts, drinks, snacks, dinners, and desserts from around the world. Alongside recipes for foods such as Irish soda bread, ANZAC biscuits, ramen noodle soup, and mango lassi, step-by-step photography and profiles feature children from a wide range of backgrounds honoring their heritage and preparing dishes that reflect their unique food traditions. A pop-out food passport, world language flash cards, and flag stickers provide additional fun on their global food journey, while infographics encourage taste-test explorations of fruits, drinks, breads, vegetables, and ice creams from around the world. Kids will be inspired to expand their palates as they cook, discovering new flavors while developing pride and appreciation for the foods they’ve grown up with.', 'Cooking Class Global Feast!', 0, '44 Recipes That Celebrate the World\'s Cultures', NULL), -(31, 31, 'Helaine Becker', NULL, '2020-01-11 22:02:24', '2020-01-11 22:02:24', 3, '', '', 'John Bindon', '1771388110', 9781771388115, 32, 2019, NULL, NULL, 'Meet some gigantic prehistoric critters! A bug the size of a small crocodile? Or as large as a basketball player? As scary as it seems, supersized, insect-like creatures such as these roamed Earth long before humans. This peek into prehistory introduces seven of these fascinating megabugs — the ancestors of modern-day insects, spiders, crabs and other arthropods — which lived from 480 million to 47 million years ago. It explores when, where and how they each lived, why they grew so big and what caused their eventual extinction. Kids will never look at bugs the same way again!', 'Megabugs and Other Prehistoric Critters That Roamed the Planet', 0, NULL, NULL), -(32, 32, 'Volker Mehnert', NULL, '2020-01-11 22:08:14', '2020-01-11 22:08:14', 3, '', '', 'Claudia Lieb', '1615196315', 9781615196319, 112, 2019, NULL, NULL, 'Before Darwin . . . before Lewis and Clark . . . there was Alexander von Humboldt. Explorer. Naturalist. All-around genius. Lost hero of science. In his time, Alexander von Humboldt (1769–1859) was world-famous. Why? He led one of the first major scientific expeditions into the South American rain forest and another into the wilds of Siberia. Carrying fragile instruments, he navigated perilous rapids and climbed the volcano of Tenerife. He observed animals, plants, and cultures that no one in Europe had ever dreamed of, and his books about them inspired a whole generation of scientists—including Charles Darwin. But before he did any of that, he was a little boy who was curious about everything (especially bugs)! The Incredible yet True Adventures of Alexander von Humboldt will whisk you away to another time and place. Meet the young man who, defying his mother’s wishes, became a daring explorer-scientist—and follow along as he makes his amazing discoveries. Lavish illustrations bring Humboldt’s untamed world to life. See nature through the eyes of a great early scientist. Wonder awaits!', 'The Incredible yet True Adventures of Alexander von Humboldt', 0, 'The Greatest Inventor-Naturalist-Scientist-Explorer Who Ever Lived', NULL), -(33, 33, 'Jennifer Swanson', NULL, '2020-01-11 22:11:36', '2020-01-11 22:11:36', 3, '', '', 'TeMika Grooms', '1682630226', 9781682630228, 104, 2020, NULL, NULL, 'This entertaining book navigates readers through the history of car production and offers a front?seat view of the science and engineering that makes the world\'s most important vehicle safe for us to drive. Cars take us to work. To school. To soccer practice. To the grocery store and home again. Can you imagine a world without them? It\'s not easy! One of the reasons we can use cars so much in our everyday lives is because they are safe to drive. But that hasn\'t always been the case. If it weren\'t for the experiments conducted over decades that involved all kinds of crash test volunteers--dead, alive, animal, or automated--cars as we know them might not be around. And then how would you get to school? Filled with fun four?wheeled nuggets of history and explanations of how cars actually work, this nonfiction book from former science educator and award-winning author Jennifer Swanson will appeal to lovers of all things that go and readers who are interested in getting in under the hood and seeing how things work.', 'Save the Crash-Test Dummies', 0, NULL, NULL), -(34, 34, 'Eileen R. Meyer', NULL, '2020-01-11 22:16:12', '2020-01-11 07:00:00', 3, '', '', 'Dave Szalay', '1580899374', 9781580899376, 48, 2020, NULL, NULL, 'Tallest, wisest, most studious--Lincoln was simply superlative! Get to know the personal side of Honest Abe (his LEAST FAVORITE nickname) through fresh and funny poems expressing his superlative nature. Abraham Lincoln is famous for many extremes: he was the TALLEST president, who gave the GREATEST SPEECH and had the STRONGEST conviction. But did you know that he was also the MOST DISTRACTED farmer, the BEST wrestler, and the CRAFTIEST storyteller? Nineteen poems share fascinating stories about events in Lincoln\'s life, while history notes go even deeper into how he excelled. Don\'t forget to think of all the ways you, too, are superlative!', 'The Superlative A. Lincoln', 0, 'Poems About Our 16th President', NULL), -(35, 35, 'Katarina Strömgård', NULL, '2020-01-11 22:20:50', '2020-01-11 22:20:50', 3, '', '', 'Katarina Strömgård', '0802855113', 9780802855114, 32, 2019, NULL, NULL, 'An imaginative book for anyone who’s ever wanted a pet\r\n\r\nLucy wants a pet more than anything, even though her mom always says no. But one night, Lucy hears a scratching sound from behind her wallpaper, and a ghostly cat named Silvring appears. Silvring takes Lucy on an adventure and introduces her to a world filled with secret pets just like hers. Not all the secret pets are as friendly as Silvring, though.\r\n\r\nFilled with magical realism, this beautiful book will resonate with animal lovers of all ages.', 'The Secret Cat', 0, NULL, NULL), -(36, 36, 'Elizabeth Haidle', NULL, '2020-01-11 22:25:34', '2020-01-11 22:25:34', 3, '', '', '', '1328801535', 9781328801531, 64, 2020, NULL, NULL, 'This exciting debut in graphic novel format tells the childhood stories of literary legends including Maya Angelou, Roald Dahl, and Sandra Cisnernos. Perfect for fans of Good Night Stories for Rebel Girls and Brazen: Rebel Ladies Who Rocked the World.\r\n\r\nWhat makes a writer? What inspires them? Where do their stories come from? Striking illustrations and a popular graphic novel format bring to life this anthology of literary legends and their childhoods. Featuring beloved authors such as Maya Angelou, C.S. Lewis, Gene Luen Yang, and J.K. Rowling, these stories capture the childhood triumphs, failures, and inspirations that predated their careers.\r\n\r\nChildren ages ten and up will see themselves in these humanized portraits and wonder if they, too, might have it in them to write. A celebration of creativity, this collective graphic biography is sprinkled throughout with writing wisdom and inspiring quotes.', 'Before They Were Authors', 0, 'Famous Writers as Kids', NULL), -(37, 37, 'Robert Burleigh', NULL, '2020-01-11 22:30:19', '2020-01-11 22:30:19', 3, '', '', 'Sterling Hundley', '1419733583', 9781419733581, 64, 2019, NULL, NULL, 'Dramatic, lyrical, and beautifully illustrated, O Captain, My Captain tells the story of one of America\'s greatest poets and how he was inspired by one of America\'s greatest presidents. Whitman and Lincoln shared the national stage in Washington, DC, during the Civil War. Though the two men never met, Whitman would often see Lincoln\'s carriage on the road. The president was never far from the poet\'s mind, and Lincoln\'s \"grace under pressure\" was something Whitman returned to again and again in his poetry. Whitman witnessed Lincoln\'s second inauguration and mourned along with America as Lincoln\'s funeral train wound its way across the landscape to his final resting place. The book includes the poem \"O Captain! My Captain!\" and an excerpt from \"When Lilacs Last in the Dooryard Bloom\'d,\" brief bios of Lincoln and Whitman, a timeline of Civil War events, endnotes, and a bibliography.', 'O Captain, My Captain', 0, 'Walt Whitman, Abraham Lincoln, and the Civil War', NULL), +(30, 30, 'Deanna F. Cook', NULL, '2020-01-11 21:57:50', '2020-01-11 21:57:50', 4, '', '', '', '1635862302', 9781635862300, 144, 2019, NULL, NULL, 'Food is a fun way to celebrate diversity, and in her new kids’ cookbook, best-selling author Deanna F. Cook leads young chefs on a tasty tour of global cultures and cuisines. Kids gain practical kitchen skills through preparing breakfasts, drinks, snacks, dinners, and desserts from around the world. Alongside recipes for foods such as Irish soda bread, ANZAC biscuits, ramen noodle soup, and mango lassi, step-by-step photography and profiles feature children from a wide range of backgrounds honoring their heritage and preparing dishes that reflect their unique food traditions. A pop-out food passport, world language flash cards, and flag stickers provide additional fun on their global food journey, while infographics encourage taste-test explorations of fruits, drinks, breads, vegetables, and ice creams from around the world. Kids will be inspired to expand their palates as they cook, discovering new flavors while developing pride and appreciation for the foods they’ve grown up with.', 'Cooking Class Global Feast!', 0, '44 Recipes That Celebrate the World\'s Cultures', NULL), +(31, 31, 'Helaine Becker', NULL, '2020-01-11 22:02:24', '2020-01-11 22:02:24', 4, '', '', 'John Bindon', '1771388110', 9781771388115, 32, 2019, NULL, NULL, 'Meet some gigantic prehistoric critters! A bug the size of a small crocodile? Or as large as a basketball player? As scary as it seems, supersized, insect-like creatures such as these roamed Earth long before humans. This peek into prehistory introduces seven of these fascinating megabugs — the ancestors of modern-day insects, spiders, crabs and other arthropods — which lived from 480 million to 47 million years ago. It explores when, where and how they each lived, why they grew so big and what caused their eventual extinction. Kids will never look at bugs the same way again!', 'Megabugs and Other Prehistoric Critters That Roamed the Planet', 0, NULL, NULL), +(32, 32, 'Volker Mehnert', NULL, '2020-01-11 22:08:14', '2020-01-11 22:08:14', 4, '', '', 'Claudia Lieb', '1615196315', 9781615196319, 112, 2019, NULL, NULL, 'Before Darwin . . . before Lewis and Clark . . . there was Alexander von Humboldt. Explorer. Naturalist. All-around genius. Lost hero of science. In his time, Alexander von Humboldt (1769–1859) was world-famous. Why? He led one of the first major scientific expeditions into the South American rain forest and another into the wilds of Siberia. Carrying fragile instruments, he navigated perilous rapids and climbed the volcano of Tenerife. He observed animals, plants, and cultures that no one in Europe had ever dreamed of, and his books about them inspired a whole generation of scientists—including Charles Darwin. But before he did any of that, he was a little boy who was curious about everything (especially bugs)! The Incredible yet True Adventures of Alexander von Humboldt will whisk you away to another time and place. Meet the young man who, defying his mother’s wishes, became a daring explorer-scientist—and follow along as he makes his amazing discoveries. Lavish illustrations bring Humboldt’s untamed world to life. See nature through the eyes of a great early scientist. Wonder awaits!', 'The Incredible yet True Adventures of Alexander von Humboldt', 0, 'The Greatest Inventor-Naturalist-Scientist-Explorer Who Ever Lived', NULL), +(33, 33, 'Jennifer Swanson', NULL, '2020-01-11 22:11:36', '2020-01-11 22:11:36', 4, '', '', 'TeMika Grooms', '1682630226', 9781682630228, 104, 2020, NULL, NULL, 'This entertaining book navigates readers through the history of car production and offers a front?seat view of the science and engineering that makes the world\'s most important vehicle safe for us to drive. Cars take us to work. To school. To soccer practice. To the grocery store and home again. Can you imagine a world without them? It\'s not easy! One of the reasons we can use cars so much in our everyday lives is because they are safe to drive. But that hasn\'t always been the case. If it weren\'t for the experiments conducted over decades that involved all kinds of crash test volunteers--dead, alive, animal, or automated--cars as we know them might not be around. And then how would you get to school? Filled with fun four?wheeled nuggets of history and explanations of how cars actually work, this nonfiction book from former science educator and award-winning author Jennifer Swanson will appeal to lovers of all things that go and readers who are interested in getting in under the hood and seeing how things work.', 'Save the Crash-Test Dummies', 0, NULL, NULL), +(34, 34, 'Eileen R. Meyer', NULL, '2020-01-11 22:16:12', '2020-01-11 07:00:00', 4, '', '', 'Dave Szalay', '1580899374', 9781580899376, 48, 2020, NULL, NULL, 'Tallest, wisest, most studious--Lincoln was simply superlative! Get to know the personal side of Honest Abe (his LEAST FAVORITE nickname) through fresh and funny poems expressing his superlative nature. Abraham Lincoln is famous for many extremes: he was the TALLEST president, who gave the GREATEST SPEECH and had the STRONGEST conviction. But did you know that he was also the MOST DISTRACTED farmer, the BEST wrestler, and the CRAFTIEST storyteller? Nineteen poems share fascinating stories about events in Lincoln\'s life, while history notes go even deeper into how he excelled. Don\'t forget to think of all the ways you, too, are superlative!', 'The Superlative A. Lincoln', 0, 'Poems About Our 16th President', NULL), +(35, 35, 'Katarina Strömgård', NULL, '2020-01-11 22:20:50', '2020-01-11 22:20:50', 4, '', '', 'Katarina Strömgård', '0802855113', 9780802855114, 32, 2019, NULL, NULL, 'An imaginative book for anyone who’s ever wanted a pet\r\n\r\nLucy wants a pet more than anything, even though her mom always says no. But one night, Lucy hears a scratching sound from behind her wallpaper, and a ghostly cat named Silvring appears. Silvring takes Lucy on an adventure and introduces her to a world filled with secret pets just like hers. Not all the secret pets are as friendly as Silvring, though.\r\n\r\nFilled with magical realism, this beautiful book will resonate with animal lovers of all ages.', 'The Secret Cat', 0, NULL, NULL), +(36, 36, 'Elizabeth Haidle', NULL, '2020-01-11 22:25:34', '2020-01-11 22:25:34', 4, '', '', '', '1328801535', 9781328801531, 64, 2020, NULL, NULL, 'This exciting debut in graphic novel format tells the childhood stories of literary legends including Maya Angelou, Roald Dahl, and Sandra Cisnernos. Perfect for fans of Good Night Stories for Rebel Girls and Brazen: Rebel Ladies Who Rocked the World.\r\n\r\nWhat makes a writer? What inspires them? Where do their stories come from? Striking illustrations and a popular graphic novel format bring to life this anthology of literary legends and their childhoods. Featuring beloved authors such as Maya Angelou, C.S. Lewis, Gene Luen Yang, and J.K. Rowling, these stories capture the childhood triumphs, failures, and inspirations that predated their careers.\r\n\r\nChildren ages ten and up will see themselves in these humanized portraits and wonder if they, too, might have it in them to write. A celebration of creativity, this collective graphic biography is sprinkled throughout with writing wisdom and inspiring quotes.', 'Before They Were Authors', 0, 'Famous Writers as Kids', NULL), +(37, 37, 'Robert Burleigh', NULL, '2020-01-11 22:30:19', '2020-01-11 22:30:19', 4, '', '', 'Sterling Hundley', '1419733583', 9781419733581, 64, 2019, NULL, NULL, 'Dramatic, lyrical, and beautifully illustrated, O Captain, My Captain tells the story of one of America\'s greatest poets and how he was inspired by one of America\'s greatest presidents. Whitman and Lincoln shared the national stage in Washington, DC, during the Civil War. Though the two men never met, Whitman would often see Lincoln\'s carriage on the road. The president was never far from the poet\'s mind, and Lincoln\'s \"grace under pressure\" was something Whitman returned to again and again in his poetry. Whitman witnessed Lincoln\'s second inauguration and mourned along with America as Lincoln\'s funeral train wound its way across the landscape to his final resting place. The book includes the poem \"O Captain! My Captain!\" and an excerpt from \"When Lilacs Last in the Dooryard Bloom\'d,\" brief bios of Lincoln and Whitman, a timeline of Civil War events, endnotes, and a bibliography.', 'O Captain, My Captain', 0, 'Walt Whitman, Abraham Lincoln, and the Civil War', NULL), (38, 38, 'Anne Fine, Michael Morpurgo, Jacqueline Wilson, Michael Rosen, Anthony Browne, Julia Donaldson, Malorie Blackman, Chris Riddell, Lauren Child, Quentin Blake', NULL, '2020-01-11 22:36:24', '2020-01-11 22:36:24', 3, '', '', '', '1536205362', 9781536205367, 80, 2019, NULL, NULL, 'In a beautiful anthology, ten children\'s book greats share stories, poems, pictures, tips, and prompts meant to inspire young readers to create works of their own. Have you ever sparked the start of a story by playing a game of What if? Is there any value to all that doodling you do? What does being \"a sponge\" have to do with facing down a blank page? Did you know that pictures can sometimes inspire stories, rather than the other way around? From Quentin Blake\'s drawings of fantastical vehicles to Michael Rosen\'s inside look at his poetry, from Anthony Browne\'s shape game (no need to be an artist to play) to Lauren Child\'s look at her creative process, this anthology -- whose contributors were all British Children\'s Laureates -- aims to encourage budding writers and artists to let their imaginations soar. The final spread is a collection of prompts from all the contributors, passing the creative torch to the next generation. ', 'Flights of Fancy', 0, 'Creative Inspiration from Ten Award-Winning Authors and Illustrators', NULL), (39, 39, 'Constance Rbeck-Nilssen', NULL, '2020-01-11 22:42:50', '2020-01-11 22:42:50', 3, '', '', 'Akin Duzakin', '0802855180', 9780802855183, 40, 2019, NULL, NULL, 'A haunting, poignant story about refugees\r\n\r\nAs a young girl and her mother take shelter for the night in their war-torn city, the whole world appears muted and dark. When the girl wakes in the middle of the night to find a bird watching her, she knows it’s the one from her mother’s stories, who flies down from the mountains to protect people from harm. She tells the bird what her life used to be like, before the war and destruction—she describes her favorite dress, the open market stalls, her dad playing music on the roof. As she continues to remember, colors slowly seep back into her life, and with them comes the courage to hope for a new beginning.\r\n\r\nThis evocative story is a wonderful conversation starter about an important and timely topic.', 'Vanishing Colors', 0, NULL, NULL), (40, 40, 'Gilles Bachelet', NULL, '2020-01-11 22:45:46', '2020-01-11 22:45:46', 3, '', '', '', '0802855121', 9780802855121, 32, 2019, NULL, NULL, 'A whimsical bedtime book perfect for sharing.\r\n\r\nReading stories is a cherished bedtime ritual, a special moment that parents savor with their children—no matter what their species! In this funny yet tender book, a stork reads to her chick in their rooftop nest, a walrus tucks his calf into an igloo cradle, and an alien tells his child a story in zero gravity.\r\n\r\nBoth parents and children will fall in love with the adorable cast of characters in this charming book.', 'A Story That Grows', 0, NULL, NULL), @@ -6112,23 +6116,23 @@ INSERT INTO `books` (`id`, `story_id`, `author`, `cover_image`, `date_created`, (2874, 2874, 'Claire Palfreman-Bunker', NULL, '2020-07-15 23:40:33', '2020-07-15 23:41:46', 3, '', '', 'Adam Relf', '0545025958', 9780545025959, 0, 2007, NULL, NULL, 'If kittens take a catnap curled up in a ball, do foals take a horsenap when sleeping in a stall? Find out what naps the other baby animals are going to take.', 'Can Kittens Take a Catnap?', NULL, NULL, NULL), (2875, 2875, 'Cindy Ward', NULL, '2020-07-15 23:45:23', '2020-07-15 23:45:23', 3, '', '', 'Tomie DePaola', '059043604X', 9780590436045, 32, 1990, NULL, NULL, 'Cookie the cat gets into a different kind of mischief every day of the week.', 'Cookie\'s Week', NULL, NULL, NULL), (2876, 2876, 'Caroline Stutson', NULL, '2020-07-15 23:49:20', '2020-07-20 21:28:16', 3, '', '', 'John Segal', '0439761247', 9780439761246, 0, 2005, NULL, NULL, 'Rhyming text and illustrations show different animal mothers expressing love for their offspring.', 'Mama Loves You', NULL, NULL, NULL), -(2877, 2877, 'David Wiesner', NULL, '2020-07-15 23:54:54', '2020-07-15 23:54:54', 3, '', '', 'David Wiesner', '0618194576', 9780618194575, 39, 2006, NULL, NULL, 'A bright, science-minded boy goes to the beach equipped to collect and examine flotsam--anything floating that has been washed ashore. Bottles, lost toys, small objects of every description are among his usual finds. But there\'s no way he could have prepared for one particular discovery: a barnacle-encrusted underwater camera, with its own secrets to share... and to keep.', 'Flotsam', NULL, NULL, NULL), -(2878, 2878, 'Aesop', NULL, '2020-07-15 23:58:18', '2020-07-15 23:58:18', 3, '', '', 'Jerry Pinkney', '0316013560', 9780316013567, 40, 2009, NULL, NULL, 'In this wordless retelling of an Aesop fable set in the African Serengeti, an adventuresome mouse proves that even small creatures are capable of great deeds when she rescues the King of the Jungle.', 'The Lion & the Mouse', NULL, NULL, NULL), -(2879, 2879, 'Aaron Becker', NULL, '2020-07-16 00:04:46', '2020-07-16 00:04:46', 3, '', '', 'Aaron Becker', '0763677302', 9780763677305, 40, 2016, NULL, NULL, 'Failing to get the attention of her busy father, a lonely girl turns back to a fantastic world for friendship and adventure. It’s her third journey into the enticing realm of kings and emperors, castles and canals, exotic creatures and enchanting landscapes. This time, it will take something truly powerful to persuade her to return home.', 'Return', NULL, NULL, NULL), -(2880, 1867, 'Chris d\'Lacey', NULL, '2020-07-16 00:09:02', '2022-09-22 02:26:03', 6, '', '', '', '0439672449', 9780439672443, 341, 2007, NULL, NULL, 'When David moves in with Liz and Lucy, he discovers a collection of hand crafted, clay dragons that comes to life and has magical powers. David\'s personalized dragon, Gadzooks, can forecast the future, and inspires him to write a story which reveals the truth behind an unsolved mystery close to home. The story has an unhappy ending, and when David realizes the consequences of it he is angry. Then David finds Gadzooks crying and near death, and he discovers that these special dragons die when they are not loved. Soon David is forced to save his friend and unlock the powers of the fire within.', 'Fire Within ', NULL, NULL, NULL), -(2881, 2881, 'Alan Baker', NULL, '2020-07-16 00:09:44', '2020-07-16 00:09:44', 3, '', '', 'Alan Baker', '0753452553', 9780753452554, 24, 1994, NULL, NULL, 'Brown Rabbit nudges open a square gift box and finds five balloons which take on all sorts of shapes.', 'Brown Rabbit\'s Shape Book', NULL, NULL, NULL), -(2882, 2882, 'Ellen Stoll Walsh', NULL, '2020-07-16 00:14:25', '2020-07-16 00:16:53', 3, '', '', '', '0152560254', 9780152560256, 32, 1989, NULL, NULL, 'Three white mice discover jars of red, blue, and yellow paint and explore the world of color.', 'Mouse Paint', NULL, NULL, NULL), -(2883, 2882, 'Ellen Stoll Walsh', NULL, '2020-07-16 00:22:12', '2020-07-16 00:22:52', 3, '', '', 'Mouse Paint', '0590132075', 0, 32, 1989, NULL, NULL, 'Three white mice discover jars of red, blue, and yellow paint and explore the world of color.', 'Mouse Paint', NULL, NULL, NULL), +(2877, 2877, 'David Wiesner', NULL, '2020-07-15 23:54:54', '2020-07-15 23:54:54', 7, '', '', 'David Wiesner', '0618194576', 9780618194575, 39, 2006, NULL, NULL, 'A bright, science-minded boy goes to the beach equipped to collect and examine flotsam--anything floating that has been washed ashore. Bottles, lost toys, small objects of every description are among his usual finds. But there\'s no way he could have prepared for one particular discovery: a barnacle-encrusted underwater camera, with its own secrets to share... and to keep.', 'Flotsam', NULL, NULL, NULL), +(2878, 2878, 'Aesop', NULL, '2020-07-15 23:58:18', '2020-07-15 23:58:18', 7, '', '', 'Jerry Pinkney', '0316013560', 9780316013567, 40, 2009, NULL, NULL, 'In this wordless retelling of an Aesop fable set in the African Serengeti, an adventuresome mouse proves that even small creatures are capable of great deeds when she rescues the King of the Jungle.', 'The Lion & the Mouse', NULL, NULL, NULL), +(2879, 2879, 'Aaron Becker', NULL, '2020-07-16 00:04:46', '2020-07-16 00:04:46', 7, '', '', 'Aaron Becker', '0763677302', 9780763677305, 40, 2016, NULL, NULL, 'Failing to get the attention of her busy father, a lonely girl turns back to a fantastic world for friendship and adventure. It’s her third journey into the enticing realm of kings and emperors, castles and canals, exotic creatures and enchanting landscapes. This time, it will take something truly powerful to persuade her to return home.', 'Return', NULL, NULL, NULL), +(2880, 1867, 'Chris d\'Lacey', NULL, '2020-07-16 00:09:02', '2022-09-22 02:26:03', 2, '', '', '', '0439672449', 9780439672443, 341, 2007, NULL, NULL, 'When David moves in with Liz and Lucy, he discovers a collection of hand crafted, clay dragons that comes to life and has magical powers. David\'s personalized dragon, Gadzooks, can forecast the future, and inspires him to write a story which reveals the truth behind an unsolved mystery close to home. The story has an unhappy ending, and when David realizes the consequences of it he is angry. Then David finds Gadzooks crying and near death, and he discovers that these special dragons die when they are not loved. Soon David is forced to save his friend and unlock the powers of the fire within.', 'Fire Within ', NULL, NULL, NULL), +(2881, 2881, 'Alan Baker', NULL, '2020-07-16 00:09:44', '2020-07-16 00:09:44', 4, '', '', 'Alan Baker', '0753452553', 9780753452554, 24, 1994, NULL, NULL, 'Brown Rabbit nudges open a square gift box and finds five balloons which take on all sorts of shapes.', 'Brown Rabbit\'s Shape Book', NULL, NULL, NULL), +(2882, 2882, 'Ellen Stoll Walsh', NULL, '2020-07-16 00:14:25', '2020-07-16 00:16:53', 4, '', '', '', '0152560254', 9780152560256, 32, 1989, NULL, NULL, 'Three white mice discover jars of red, blue, and yellow paint and explore the world of color.', 'Mouse Paint', NULL, NULL, NULL), +(2883, 2882, 'Ellen Stoll Walsh', NULL, '2020-07-16 00:22:12', '2020-07-16 00:22:52', 4, '', '', 'Mouse Paint', '0590132075', 0, 32, 1989, NULL, NULL, 'Three white mice discover jars of red, blue, and yellow paint and explore the world of color.', 'Mouse Paint', NULL, NULL, NULL), (2884, 2357, 'Chris D\'Lacey', NULL, '2020-07-16 00:42:04', '2022-09-22 02:26:03', 714, '', '', '', '0545051649', 9780545051644, 507, 2010, NULL, NULL, 'Five years have passed since David Rain, now a bestselling author, disappeared mysteriously in the Arctic. And slowly the ice is changing, bears are starving, dragons are rising, the souls of the Inuit dead are haunting the skies. The spirit Gaia, goddess of the Earth, is restless, aching to bring down her might upon these changes. But all living things may suffer if she does.\r\n\r\nAs the weather grows wilder and the ice caps melt, all eyes turn from the north to David\'s daughter, Alexa. She is the key to stopping Gaia...but can one girl save the world from the forces of evil, or will she disappear like her father?', 'The Fire Eternal', NULL, NULL, NULL), (2885, 2885, 'Leo Lionni', NULL, '2020-07-16 00:57:29', '2020-07-16 02:07:21', 3, '', '', 'Leo Lionni', '0590482793', 0, 30, 1994, NULL, NULL, 'Elephants are gray. Pigs are pink. Only the chameleon has no color of his own. He is purple like the heather, yellow like a lemon, even black and orange striped like a tiger! Then one day a chameleon has an idea to remain one color forever by staying on the greenest leaf he can find. But in the autumn, the leaf changes from green to yellow to red . . . and so does the chameleon. When another chameleon suggests they travel together, he learns that companionship is more important than having a color of his own. No matter where he goes with his new friend, they will always be alike.', 'A Color of His Own', NULL, NULL, NULL), (2886, 2886, 'Leo Lionni', NULL, '2020-07-16 01:06:56', '2020-07-16 01:06:56', 3, '', '', 'Leo Lionni', '0590430491', 9780399555503, 32, 1989, NULL, NULL, 'Deep in the sea, there lives a happy school of little fish. Their watery world is full of wonders, but there is also danger, and the little fish are afraid to come out of hiding . . . until Swimmy comes along. Swimmy shows his friends how—with ingenuity and teamwork—they can overcome any danger.', 'Swimmy', NULL, NULL, NULL), (2887, 2887, 'Leo Lionni', NULL, '2020-07-16 01:22:52', '2020-07-16 01:22:52', 3, '', '', 'Leo Lionni', '0590979396', 0, 32, 1967, NULL, NULL, 'While other mice are gathering food for the winter, Frederick seems to daydream the summer away. When dreary winter comes, it is Frederick the poet-mouse who warms his friends and cheers them with his words.', 'Frederick', NULL, NULL, NULL), -(2888, 2888, 'Margaret Wise Brown', NULL, '2020-07-16 01:31:01', '2020-07-16 01:31:01', 3, '', '', 'Alice Provensen, Martin Provensen', '0439273048', 0, 24, 2001, NULL, NULL, 'While the color kittens are trying to make green paint, their mixing leads to pink, orange, and purple.', 'The Color Kittens', NULL, NULL, NULL), -(2889, 2889, 'Margaret Wise Brown', NULL, '2020-07-16 01:45:02', '2020-07-20 21:31:13', 3, '', '', 'Loretta Krupinski', '0439450659', 0, 0, 2002, NULL, NULL, 'Rhyming verses describe things that are red, orange, yellow, green, blue, purple, brown, black, gray, white, and pink.', 'My World of Color', NULL, NULL, NULL), -(2890, 2890, 'Rick Walton', NULL, '2020-07-16 01:51:07', '2020-07-16 01:51:07', 3, '', '', 'Paige Miglio', '0439515858', 0, 31, 2003, NULL, NULL, 'A bunny family spends the day together.', 'Bunny Day', NULL, 'Telling Time from Breakfast to Bedtime', NULL), -(2891, 2891, 'Alan Baker', NULL, '2020-07-16 01:57:55', '2020-07-16 01:57:55', 3, '', '', 'Alan Baker', '0439449693', 0, 29, 2003, NULL, NULL, 'Little Rabbits encounter all their favorite farmyard friends. And don\'t forget to look for Mouse as he plays hide-and-seek in and around the farmyard.', 'Little Rabbits\' First Farm Book', NULL, NULL, NULL), -(2892, 2892, 'Jane Cabrera', NULL, '2020-07-16 02:02:06', '2020-07-16 02:02:06', 3, '', '', 'Jane Cabrera', '0590035851', 0, 32, 1998, NULL, NULL, 'What is Cat\'s favorite color? Is it green, like the grass where he likes to walk? Or yellow, like the sand on a sunny beach? Children who are learning new colors can join in Cat\'s fun, as he explores the colors all around him. ', 'Cat\'s Colors', NULL, NULL, NULL), -(2893, 2893, 'David Wiesner', NULL, '2020-07-16 02:06:34', '2020-07-16 02:06:34', 3, '', '', 'David Wiesner', '059045983X', 0, 32, 1992, NULL, NULL, 'When he falls asleep with a book in his arms, a young boy dreams an amazing dream about dragons, about castles, and an unchartered, faraway land. ', 'Free Fall', NULL, NULL, NULL), +(2888, 2888, 'Margaret Wise Brown', NULL, '2020-07-16 01:31:01', '2020-07-16 01:31:01', 5, '', '', 'Alice Provensen, Martin Provensen', '0439273048', 0, 24, 2001, NULL, NULL, 'While the color kittens are trying to make green paint, their mixing leads to pink, orange, and purple.', 'The Color Kittens', NULL, NULL, NULL), +(2889, 2889, 'Margaret Wise Brown', NULL, '2020-07-16 01:45:02', '2020-07-20 21:31:13', 5, '', '', 'Loretta Krupinski', '0439450659', 0, 0, 2002, NULL, NULL, 'Rhyming verses describe things that are red, orange, yellow, green, blue, purple, brown, black, gray, white, and pink.', 'My World of Color', NULL, NULL, NULL), +(2890, 2890, 'Rick Walton', NULL, '2020-07-16 01:51:07', '2020-07-16 01:51:07', 5, '', '', 'Paige Miglio', '0439515858', 0, 31, 2003, NULL, NULL, 'A bunny family spends the day together.', 'Bunny Day', NULL, 'Telling Time from Breakfast to Bedtime', NULL), +(2891, 2891, 'Alan Baker', NULL, '2020-07-16 01:57:55', '2020-07-16 01:57:55', 5, '', '', 'Alan Baker', '0439449693', 0, 29, 2003, NULL, NULL, 'Little Rabbits encounter all their favorite farmyard friends. And don\'t forget to look for Mouse as he plays hide-and-seek in and around the farmyard.', 'Little Rabbits\' First Farm Book', NULL, NULL, NULL), +(2892, 2892, 'Jane Cabrera', NULL, '2020-07-16 02:02:06', '2020-07-16 02:02:06', 5, '', '', 'Jane Cabrera', '0590035851', 0, 32, 1998, NULL, NULL, 'What is Cat\'s favorite color? Is it green, like the grass where he likes to walk? Or yellow, like the sand on a sunny beach? Children who are learning new colors can join in Cat\'s fun, as he explores the colors all around him. ', 'Cat\'s Colors', NULL, NULL, NULL), +(2893, 2893, 'David Wiesner', NULL, '2020-07-16 02:06:34', '2020-07-16 02:06:34', 5, '', '', 'David Wiesner', '059045983X', 0, 32, 1992, NULL, NULL, 'When he falls asleep with a book in his arms, a young boy dreams an amazing dream about dragons, about castles, and an unchartered, faraway land. ', 'Free Fall', NULL, NULL, NULL), (2894, 2894, 'Eve Bunting', NULL, '2020-07-16 16:46:33', '2020-07-16 16:46:33', 89, '', '', '', '0439411149', 0, 170, 2002, NULL, NULL, 'Enjoy best-selling author Eve Bunting’s moving story about the bond between a boy and his dog. \"Maybe that\'s one of the reasons people get dogs, to kind of close up the empty places inside them.\" Eleven-year-old William never needed a friend more than now. After his parents\' separation, his father\'s new engagement, and his grandfather\'s dying without any warning—adopting big, beautiful Riley is the first thing in a long time that has made him feel better. That is, until Riley innocently chases a horse. Local law states that any animal that chases livestock must be put to sleep. Suddenly William stands to lose another thing close to him. Together with his friend Grace, William begins a campaign to reverse the county commissioners\' decision. But with a community divided on the issue, and the bully Ellis Porter trying to stop them at every turn, will they be able to save Riley\'s life? ', 'The Summer of Riley', NULL, NULL, NULL), (2895, 2895, 'Michael Morpurgo', NULL, '2020-07-16 17:02:04', '2020-07-16 17:02:04', 89, '', '', '', '0439591813', 0, 161, 2003, NULL, NULL, 'When Michael\'s father loses his job, he buys a boat and convinces Michael and his mother to sail around the world. It\'s an ideal trip - even Michael\'s sheepdog can come along. It starts out as the perfect family adventure - until Michael is swept overboard. He\'s washed up on an island, where he struggles to survive. Then he discovers that he\'s not alone. His fellow-castaway, Kensuke, is wary of him. But when Michael\'s life is threatened, Kensuke slowly lets the boy into his world. The two develop a close understanding in this remote place, but the question of rescue continues to divide them.', 'Kensuke\'s Kingdom', NULL, NULL, NULL), (2896, 2896, 'Jean Craighead George', NULL, '2020-07-16 17:17:31', '2020-07-16 17:17:31', 89, '', '', 'Donna Diamond', '0064421066', 0, 67, 1999, NULL, NULL, 'Balto the sled dog raced over the Arctic to bring life-saving medicine to an Alaskan town stricken with diphtheria. Sugar, an ordinary house cat with an extraordinary sense of direction, traveled 1,500 miles on a cross-country odyssey in search of her human family. And Koko stunned the scientific world by learning sign language -- and told us what it\'s like to be a gorilla', 'Incredible Animal Adventures', NULL, NULL, NULL), @@ -6141,27 +6145,27 @@ INSERT INTO `books` (`id`, `story_id`, `author`, `cover_image`, `date_created`, (2903, 1103, 'Frances O\'Roark Dowell', NULL, '2020-07-17 14:05:14', '2022-09-22 02:26:03', 6, '', '', '', '0545207398', 9780545207393, 163, 2009, NULL, NULL, 'When twelve-year-old Jamie Dexter\'s brother joins the Army and is sent to Vietnam, Jamie is plum thrilled. She can\'t wait to get letters from the front lines describing the excitement of real-life combat: the sound of helicopters, the smell of gunpowder, the exhilaration of being right in the thick of it. After all, they\'ve both dreamed of following in the footsteps of their father, the Colonel.\r\n\r\nBut TJ\'s first letter isn\'t a letter at all. It\'s a roll of undeveloped film, the first of many. What Jamie sees when she develops TJ\'s photographs reveals a whole new side of the war. Slowly the shine begins to fade off of Army life - and the Colonel. How can someone she\'s worshipped her entire life be just as helpless to save her brother as she is?', 'Shooting the Moon', NULL, NULL, NULL), (2904, 2904, 'Steve Watkins', NULL, '2020-07-17 15:18:03', '2022-09-22 02:26:03', 3, '', '', '', '1338331485', 9781338331486, 281, 2018, 2018, 0, 'The last place on earth Taylor Sorenson wants to be is in Saigon in the middle of the Vietnam War. His mom dragged him here to visit his dad, who\'s stationed at the US embassy, and Taylor is bored out of his skull. One night, during an embassy dinner, he decides to sneak out to see the Tet celebrations in the city. But before he makes it very far, fighting erupts across all of South Vietnam--and Taylor is captured by the North Vietnamese Army.\r\n\r\nRealizing he could be an important bargaining chip, the NVA decides to move Taylor to the North. The only way there is the Ho Chi Ming Trail, a series of dangerous paths that snake from South Vietnam through Laos and Cambodia before finally reaching North Vietnam. But thousands have died on the trail, and Taylor doesn\'t know what\'s waiting for him at the end.\r\n\r\nWhat follows is a harrowing journey during one of the most controversial wars in US history, where one boy is forced to confront the true cost of war, and what it really means to survive.', 'On Blood Road', NULL, 'A Vietnam War Novel', NULL), (2905, 2065, 'Jewell Parker Rhodes', NULL, '2020-07-17 17:25:16', '2022-09-22 02:26:03', 6, '', '', 'Andrea Vandergrift', '0316262226', 9780316262224, 229, 2017, NULL, NULL, 'For fifth-grader Dèja, it\'s tough enough starting school in a new neighborhood. Projects about her home and family only highlight how different she is from her classmates. Does her teacher really want an essay about living in a shelter? When Miss Garcia suggests that all her assignments have something to do with the two towers missing from the skyline out their classroom windows, Dèja is just confused. \r\n\r\nShe sets off on a journey of discovery, with new friends Ben and Sabeen by her side. But just as she gets closer to answering big questions about who she is, what America means, and how communities can grow (and heal), she uncovers new questions, too. Like, why does Pop get so angry when she brings up anything about the towers?', 'Towers Falling', NULL, NULL, NULL), -(2906, 2906, 'Jason Reynolds', NULL, '2020-07-17 17:48:59', '2022-09-22 02:26:03', 6, '', '', '', '1481438255', 9781481438254, 306, 2017, NULL, NULL, 'An intense snapshot of the chain reaction caused by a pull of a trigger. It happens in an elevator — teenaged Will is on his way to take revenge for the murder of his brother, but his plan is interrupted by a few visitors on the way down to the ground floor.', 'Long Way Down', NULL, NULL, NULL), -(2907, 2907, 'Enigma Alberti', NULL, '2020-07-17 18:21:56', '2022-09-22 02:26:03', 6, '', '', 'Laura Terry', '1523507942', 9781523507948, 95, 2019, 2019, 1, 'Spy on History: Anna Strong and the Revolutionary War Culper Spy Ring In a story of intrigue and danger, Anna Strong and the Revolutionary War Culper Spy Ring explores a little-known part of an important chapter of American history—and offers readers a mystery of their own to solve! It’s a true story of the American Revolution: Meet the secret Culper Ring, a network of American spies fighting against the army of British redcoats. Meet historical figures like George Washington and the soon-to-be-infamous Benedict Arnold. And meet Anna Strong, an unsung heroine who found ingenious ways to communicate top-secret messages to her fellow spies, helping to free the American colonies from British rule. It’s a mystery to solve: There are clues embedded in the book’s text and illustrations. Spycraft materials, including a cipher wheel, come in an envelope at the beginning of the book. Use them to decode Anna’s hidden message and discover the secret mission she undertook for the Culper Ring!', 'Anna Strong and the Revolutionary War Culper Spy Ring', NULL, NULL, NULL), -(2908, 3036, 'Gordon Korman', NULL, '2020-07-17 18:45:23', '2022-09-22 02:26:03', 6, '', '', '', '1423105168', 9781423105169, 210, 2007, NULL, NULL, 'Capricorn (Cap) Anderson has never watched television. He\'s never tasted a pizza. Never heard of a wedgie. Since he was little, his only experience has been living on a farm commune and being home-schooled by his hippie grandmother, Rain. But when Rain falls out of a tree while picking plums and has to stay in the hospital, Cap is forced to move in with a guidance counselor and her cranky teen daughter and attend the local middle school. While Cap knows a lot about tie-dying and Zen Buddhism, no education could prepare him for the politics of public school. Right from the beginning, Cap\'s weirdness makes him a moving target at Claverage Middle School (dubbed C-Average by the students). He has long, ungroomed hair; wears hemp clothes; and practises tai chi on the lawn. Once Zack Powers, big man on campus, spots Cap, he can\'t wait to introduce him to the age-old tradition at C-Average: the biggest nerd is nominated for class president-and wins.', 'Schooled', NULL, NULL, NULL), -(2909, 2909, 'Kate Messner', NULL, '2020-07-17 18:58:13', '2022-09-22 02:26:03', 3, '', '', '', '1681195380', 9781681195384, 441, 2018, 2018, 0, 'Nora Tucker is looking forward to summer vacation in Wolf Creek--two months of swimming, popsicles, and brushing up on her journalism skills for the school paper. But when two inmates break out of the town\'s maximum security prison, everything changes. Doors are locked, helicopters fly over the woods, and police patrol the school grounds. Worst of all, everyone is on edge, and fear brings out the worst in some people Nora has known her whole life. Even if the inmates are caught, she worries that home might never feel the same.', 'Breakout', NULL, '', '0'), -(2910, 2910, 'Jason Reynolds', NULL, '2020-07-17 19:23:23', '2022-09-22 02:26:03', 3, '', '', 'Alex Nabaum', '148143828X', 9781481438285, 194, 2019, 2019, 1, 'This story was going to begin like all the best stories. With a school bus falling from the sky. But no one saw it happen. They were all too busy—\r\n\r\nTalking about boogers.\r\nStealing pocket change.\r\nSkateboarding.\r\nWiping out.\r\nBraving up.\r\nExecuting complicated handshakes.\r\nPlanning an escape.\r\nMaking jokes.\r\nLotioning up.\r\nFinding comfort.\r\nBut mostly, too busy walking home.\r\n\r\nJason Reynolds conjures ten tales (one per block) about what happens after the dismissal bell rings and brilliantly weaves them into one wickedly funny, piercingly poignant look at the detours we face on the walk home, and in life.', 'Look Both Ways', NULL, 'A Tale Told in Ten Blocks', '0'), -(2911, 2911, 'Author Art', NULL, '2020-07-17 19:47:14', '2020-08-02 15:31:39', 6, '', '', '', '1719938342', 9781719938341, 123, 2018, NULL, NULL, 'Follow John on his epic journey! A journey filled with mysterious people, portals, spirits, ancient beings, and even more mysterious people. Questions lead to more questions - what will John find out on this journey that goes beyond planet Earth? And find familiar characters from Fortnite: Battle Royale! But who is a friend and who is a foe? Is everyone who they appear to be?', 'Mysteries of Fortnite', NULL, NULL, NULL), -(2912, 2912, 'Robloxia Kid', NULL, '2020-07-17 19:55:30', '2020-07-17 20:18:47', 6, '', '', '', '1719400970', 9781719400978, 77, 2018, NULL, NULL, 'It\'s a tough day for Deadpool, everyone\'s favorite Merc with a Mouth. But the day becomes even tougher when he finds a priceless artifact called the Talking Infinity Gem. Why, you ask? Because Deadpool did what he always does he shoots first and asks questions later. This less than brilliant move shatters the Gem and transports Deadpool to the fascinating world of Roblox...High School! To escape Roblox, the one and only awesome \'pool will have to retrieve the Gem before the students, or the entire Roblox server will descend into mayhem. Needless to say, Deadpool\'s katanas are out of dress code, so he isn\'t anxious to stay in Roblox High School for long.', 'Diary of a Roblox Deadpool', NULL, NULL, NULL), +(2906, 2906, 'Jason Reynolds', NULL, '2020-07-17 17:48:59', '2022-09-22 02:26:03', 7, '', '', '', '1481438255', 9781481438254, 306, 2017, NULL, NULL, 'An intense snapshot of the chain reaction caused by a pull of a trigger. It happens in an elevator — teenaged Will is on his way to take revenge for the murder of his brother, but his plan is interrupted by a few visitors on the way down to the ground floor.', 'Long Way Down', NULL, NULL, NULL), +(2907, 2907, 'Enigma Alberti', NULL, '2020-07-17 18:21:56', '2022-09-22 02:26:03', 7, '', '', 'Laura Terry', '1523507942', 9781523507948, 95, 2019, 2019, 1, 'Spy on History: Anna Strong and the Revolutionary War Culper Spy Ring In a story of intrigue and danger, Anna Strong and the Revolutionary War Culper Spy Ring explores a little-known part of an important chapter of American history—and offers readers a mystery of their own to solve! It’s a true story of the American Revolution: Meet the secret Culper Ring, a network of American spies fighting against the army of British redcoats. Meet historical figures like George Washington and the soon-to-be-infamous Benedict Arnold. And meet Anna Strong, an unsung heroine who found ingenious ways to communicate top-secret messages to her fellow spies, helping to free the American colonies from British rule. It’s a mystery to solve: There are clues embedded in the book’s text and illustrations. Spycraft materials, including a cipher wheel, come in an envelope at the beginning of the book. Use them to decode Anna’s hidden message and discover the secret mission she undertook for the Culper Ring!', 'Anna Strong and the Revolutionary War Culper Spy Ring', NULL, NULL, NULL), +(2908, 3036, 'Gordon Korman', NULL, '2020-07-17 18:45:23', '2022-09-22 02:26:03', 7, '', '', '', '1423105168', 9781423105169, 210, 2007, NULL, NULL, 'Capricorn (Cap) Anderson has never watched television. He\'s never tasted a pizza. Never heard of a wedgie. Since he was little, his only experience has been living on a farm commune and being home-schooled by his hippie grandmother, Rain. But when Rain falls out of a tree while picking plums and has to stay in the hospital, Cap is forced to move in with a guidance counselor and her cranky teen daughter and attend the local middle school. While Cap knows a lot about tie-dying and Zen Buddhism, no education could prepare him for the politics of public school. Right from the beginning, Cap\'s weirdness makes him a moving target at Claverage Middle School (dubbed C-Average by the students). He has long, ungroomed hair; wears hemp clothes; and practises tai chi on the lawn. Once Zack Powers, big man on campus, spots Cap, he can\'t wait to introduce him to the age-old tradition at C-Average: the biggest nerd is nominated for class president-and wins.', 'Schooled', NULL, NULL, NULL), +(2909, 2909, 'Kate Messner', NULL, '2020-07-17 18:58:13', '2022-09-22 02:26:03', 7, '', '', '', '1681195380', 9781681195384, 441, 2018, 2018, 0, 'Nora Tucker is looking forward to summer vacation in Wolf Creek--two months of swimming, popsicles, and brushing up on her journalism skills for the school paper. But when two inmates break out of the town\'s maximum security prison, everything changes. Doors are locked, helicopters fly over the woods, and police patrol the school grounds. Worst of all, everyone is on edge, and fear brings out the worst in some people Nora has known her whole life. Even if the inmates are caught, she worries that home might never feel the same.', 'Breakout', NULL, '', '0'), +(2910, 2910, 'Jason Reynolds', NULL, '2020-07-17 19:23:23', '2022-09-22 02:26:03', 7, '', '', 'Alex Nabaum', '148143828X', 9781481438285, 194, 2019, 2019, 1, 'This story was going to begin like all the best stories. With a school bus falling from the sky. But no one saw it happen. They were all too busy—\r\n\r\nTalking about boogers.\r\nStealing pocket change.\r\nSkateboarding.\r\nWiping out.\r\nBraving up.\r\nExecuting complicated handshakes.\r\nPlanning an escape.\r\nMaking jokes.\r\nLotioning up.\r\nFinding comfort.\r\nBut mostly, too busy walking home.\r\n\r\nJason Reynolds conjures ten tales (one per block) about what happens after the dismissal bell rings and brilliantly weaves them into one wickedly funny, piercingly poignant look at the detours we face on the walk home, and in life.', 'Look Both Ways', NULL, 'A Tale Told in Ten Blocks', '0'), +(2911, 2911, 'Author Art', NULL, '2020-07-17 19:47:14', '2020-08-02 15:31:39', 7, '', '', '', '1719938342', 9781719938341, 123, 2018, NULL, NULL, 'Follow John on his epic journey! A journey filled with mysterious people, portals, spirits, ancient beings, and even more mysterious people. Questions lead to more questions - what will John find out on this journey that goes beyond planet Earth? And find familiar characters from Fortnite: Battle Royale! But who is a friend and who is a foe? Is everyone who they appear to be?', 'Mysteries of Fortnite', NULL, NULL, NULL), +(2912, 2912, 'Robloxia Kid', NULL, '2020-07-17 19:55:30', '2020-07-17 20:18:47', 7, '', '', '', '1719400970', 9781719400978, 77, 2018, NULL, NULL, 'It\'s a tough day for Deadpool, everyone\'s favorite Merc with a Mouth. But the day becomes even tougher when he finds a priceless artifact called the Talking Infinity Gem. Why, you ask? Because Deadpool did what he always does he shoots first and asks questions later. This less than brilliant move shatters the Gem and transports Deadpool to the fascinating world of Roblox...High School! To escape Roblox, the one and only awesome \'pool will have to retrieve the Gem before the students, or the entire Roblox server will descend into mayhem. Needless to say, Deadpool\'s katanas are out of dress code, so he isn\'t anxious to stay in Roblox High School for long.', 'Diary of a Roblox Deadpool', NULL, NULL, NULL), (2913, 2913, 'Akira Himekawa', NULL, '2020-07-17 20:18:13', '2020-08-05 21:34:10', 6, '', '', 'Akira Himekawa', '1421593475', 9781421593470, 192, 2017, 2017, 1, 'Link must defeat evil at every turn in his perilous quest to help Princess Zelda! Once upon a time, wizards tried to conquer the Sacred Realm of Hyrule. The Spirits of Light sealed the wizards’ power within the Shadow Crystal and banished them to the Twilight Realm beyond the Mirror of Twilight. Now, an evil menace is trying to find Midna, Princess of the Twilight Realm, and the fragments of the Shadow Crystal to gain the power to rule over both the Twilight Realm and the World of Light. Link once trained in swordsmanship, hoping to protect the world of Hyrule. After a fateful meeting, he sought out the anonymity and peace of life in a small village. But danger and adventure always find heroes to set things right, and when the dark minions of the King of Shadows threaten his new home, Link answers the call!', 'The Legend of Zelda', NULL, 'Twilight Princess', NULL), (2914, 2914, 'Winter Morgan', NULL, '2020-07-17 20:27:38', '2020-07-17 20:27:38', 6, '', '', '', '1632207273', 9781632207265, 101, 2014, NULL, NULL, 'Steve is back and ready for more adventures! But this time the excitement lands closer to home. While walking home from the village, Steve is surprised to hear a loud BOOM! When he returns home, he finds his wheat farm destroyed and a huge crater where the wheat once grew. And his diamond sword is missing! Steve believes it’s the act of a griefer with a lot of TNT. Devastated, Steve wants to rebuild and find his sword, but with his wheat destroyed, he must call on old friends to help him. All together again, Lucy, Max, and Henry tell harrowing stories of their treasure hunts and conquests, and Steve discusses his strategy for rebuilding. They all go to sleep, excited to begin their plans; but when they wake up, Henry is missing! Looking for Henry in the village, two of Steve’s neighbors, Kyra and Adam, have been targeted as well: Kyra’s barn was flooded with lava, and Adam’s friend Thomas is missing too! ', 'The Mystery of the Griefer\'s Mark', NULL, NULL, NULL), -(2915, 2915, 'Annie Fox', NULL, '2020-07-17 20:44:29', '2022-09-22 02:26:03', 6, '', '', 'Matt Kindt', '1575423022', 9781575423029, 96, 2008, NULL, NULL, 'Jack, Jen, Chris, Abby, Mateo, and Michelle—six students just trying to figure it all out in middle school. It follows these characters as they work to meet new challenges and survive the social scene—without losing sight of who they are. ', 'Be Confident in Who You Are', NULL, NULL, NULL), -(2916, 2916, 'Grace Norwich', NULL, '2020-07-17 21:19:04', '2020-07-17 21:19:04', 6, '', '', 'Ute Simon', '0545732492', 9780545732499, 127, 2014, NULL, NULL, 'I am basketball\'s biggest superstar--I am LeBron James.LeBron James was the MVP of the 2013 basketball season and he is one of the best basketball players of all time. ', 'I Am Lebron James', NULL, NULL, NULL), -(2917, 2917, 'Ty The Hunter', NULL, '2020-07-17 23:16:14', '2020-07-17 23:16:14', 6, '', '', 'Ty The Hunter', '1985316145', 9781985316140, 0, 2019, NULL, NULL, ' Meet Jed. He knows his older brother Thomas is up to something, and he\'s determined to figure out what it is. When he decides to do some late night snooping while Thomas is asleep, the last thing he expects is to end up inside of his favorite video game. The longer he\'s there, the more he sees how much is lurking beneath the surface. The clock is ticking, find an exit before nightfall, or stay there forever. And he has got to get out because it\'s the only way he can stop the terrible plot that\'s been set into motion.', 'The World Keepers 1', NULL, NULL, NULL), +(2915, 2915, 'Annie Fox', NULL, '2020-07-17 20:44:29', '2022-09-22 02:26:03', 2, '', '', 'Matt Kindt', '1575423022', 9781575423029, 96, 2008, NULL, NULL, 'Jack, Jen, Chris, Abby, Mateo, and Michelle—six students just trying to figure it all out in middle school. It follows these characters as they work to meet new challenges and survive the social scene—without losing sight of who they are. ', 'Be Confident in Who You Are', NULL, NULL, NULL), +(2916, 2916, 'Grace Norwich', NULL, '2020-07-17 21:19:04', '2020-07-17 21:19:04', 2, '', '', 'Ute Simon', '0545732492', 9780545732499, 127, 2014, NULL, NULL, 'I am basketball\'s biggest superstar--I am LeBron James.LeBron James was the MVP of the 2013 basketball season and he is one of the best basketball players of all time. ', 'I Am Lebron James', NULL, NULL, NULL), +(2917, 2917, 'Ty The Hunter', NULL, '2020-07-17 23:16:14', '2020-07-17 23:16:14', 2, '', '', 'Ty The Hunter', '1985316145', 9781985316140, 0, 2019, NULL, NULL, ' Meet Jed. He knows his older brother Thomas is up to something, and he\'s determined to figure out what it is. When he decides to do some late night snooping while Thomas is asleep, the last thing he expects is to end up inside of his favorite video game. The longer he\'s there, the more he sees how much is lurking beneath the surface. The clock is ticking, find an exit before nightfall, or stay there forever. And he has got to get out because it\'s the only way he can stop the terrible plot that\'s been set into motion.', 'The World Keepers 1', NULL, NULL, NULL), (2918, 2918, 'Matt Forbeck', NULL, '2020-07-17 23:24:14', '2022-09-22 02:26:03', 6, '', 'Lauren Nesworthy, Julia March', '', '1465429263', 9781465429261, 127, 2017, NULL, NULL, 'What\'s better than one Super Hero? A team of them! Meet the Avengers: a crime fighting team made up of your favorite Super Heroes. Read about their superpowers, their gadgets and their greatest enemies. Can you live by the Avengers charter and help them defeat their foes? ', 'Marvel Avengers Battle Against Ultron', NULL, NULL, NULL), (2919, 2919, 'Kenneth Oppel', NULL, '2020-07-18 13:07:53', '2022-09-22 02:26:03', 3, '', '', 'Sydney Smith', '152477281X', 9781524772819, 260, 2018, 2018, 0, 'Ethan’s dad is a comic artist whose greatest creation, the mutant superhero Kren, brought him fame and glory. But after his dad’s string of successful books, a tragedy strikes the family and now his dad is completely stuck.\r\n\r\nIf only artistic talent were hereditary. Ethan is stuck on a graphic-novel project of his own at school and won’t own up to the fact that he can’t draw. When one night an ink-blot creation emerges from his father’s sketchbook, the family’s whole world begins to change.', 'Inkling', NULL, NULL, '0'), -(2920, 2920, 'Rick Riordan', NULL, '2020-07-18 13:26:14', '2020-08-11 16:26:12', 42, '', '', '', '1423163273', 9781423163275, 416, 2012, 0, 1, 'He\'s b-a-a-ack! Despite their best efforts, Carter and Sade Kane can\'t seem to keep Apophis, the chaos snake, down. Now Apophis is threatening to plunge the world into eternal darkness, and the Kanes are faced with the impossible task of having to destroy him once and for all.', 'The Serpent\'s Shadow', NULL, NULL, NULL), -(2921, 2921, 'Alison McGhee', NULL, '2020-07-18 19:09:02', '2020-07-18 19:09:02', 3, '', '', 'Harry Bliss', '0689867301', 9780689867309, 32, 2006, NULL, NULL, 'On the far side of town, in a big, dark, house, lives a brave little witch. She has heard lots and lots about those scary humans and a holiday they call Halloween, but she has never even seen Halloween for herself. Until one very special Halloween comes along… ', 'A Very Brave Witch', NULL, NULL, NULL), -(2922, 2922, 'Lisa Trumbauer', NULL, '2020-07-18 19:15:14', '2020-07-18 19:15:14', 3, '', '', 'Jannie Ho', '0545203112', 9780545203111, 28, 2009, NULL, NULL, 'After boarding the wrong school bus on Halloween, a young boy finds himself surrounded by ghosts, witches, mummies, and monsters.', 'The Haunted Ghoul Bus', NULL, NULL, NULL), -(2923, 2923, 'Anne Rockwell', NULL, '2020-07-18 19:20:05', '2020-07-18 22:39:53', 3, '', '', 'Megan Halsey', '0439155770', 0, 32, 1999, NULL, NULL, 'A child searches to find just the right pumpkin for a perfect jack-o-lantern. ', 'Pumpkin Day, Pumpkin Night', NULL, NULL, NULL), -(2924, 2924, 'Cindy Neuschwander', NULL, '2020-07-18 19:37:12', '2022-09-22 02:26:03', 6, '', '', 'Bryan Langdo', '0312561172', 9780312561178, 30, 2005, NULL, NULL, 'When Matt and Bibi are locked inside an Egyptian pyramid with only each other, their dog Riley, and geometric hieroglyphics, the twins must use their math knowledge to solve the riddles on the walls and locate the burial chamber.', 'Mummy Math', NULL, NULL, NULL), +(2920, 2920, 'Rick Riordan', NULL, '2020-07-18 13:26:14', '2020-08-11 16:26:12', 2, '', '', '', '1423163273', 9781423163275, 416, 2012, 0, 1, 'He\'s b-a-a-ack! Despite their best efforts, Carter and Sade Kane can\'t seem to keep Apophis, the chaos snake, down. Now Apophis is threatening to plunge the world into eternal darkness, and the Kanes are faced with the impossible task of having to destroy him once and for all.', 'The Serpent\'s Shadow', NULL, NULL, NULL), +(2921, 2921, 'Alison McGhee', NULL, '2020-07-18 19:09:02', '2020-07-18 19:09:02', 2, '', '', 'Harry Bliss', '0689867301', 9780689867309, 32, 2006, NULL, NULL, 'On the far side of town, in a big, dark, house, lives a brave little witch. She has heard lots and lots about those scary humans and a holiday they call Halloween, but she has never even seen Halloween for herself. Until one very special Halloween comes along… ', 'A Very Brave Witch', NULL, NULL, NULL), +(2922, 2922, 'Lisa Trumbauer', NULL, '2020-07-18 19:15:14', '2020-07-18 19:15:14', 2, '', '', 'Jannie Ho', '0545203112', 9780545203111, 28, 2009, NULL, NULL, 'After boarding the wrong school bus on Halloween, a young boy finds himself surrounded by ghosts, witches, mummies, and monsters.', 'The Haunted Ghoul Bus', NULL, NULL, NULL), +(2923, 2923, 'Anne Rockwell', NULL, '2020-07-18 19:20:05', '2020-07-18 22:39:53', 2, '', '', 'Megan Halsey', '0439155770', 0, 32, 1999, NULL, NULL, 'A child searches to find just the right pumpkin for a perfect jack-o-lantern. ', 'Pumpkin Day, Pumpkin Night', NULL, NULL, NULL), +(2924, 2924, 'Cindy Neuschwander', NULL, '2020-07-18 19:37:12', '2022-09-22 02:26:03', 2, '', '', 'Bryan Langdo', '0312561172', 9780312561178, 30, 2005, NULL, NULL, 'When Matt and Bibi are locked inside an Egyptian pyramid with only each other, their dog Riley, and geometric hieroglyphics, the twins must use their math knowledge to solve the riddles on the walls and locate the burial chamber.', 'Mummy Math', NULL, NULL, NULL), (2925, 2925, 'Jerry Pallotta, Van Wallach', NULL, '2020-07-18 19:46:21', '2020-07-18 19:46:21', 6, '', '', 'Shennen Bersani', '0439896258', 9780439896252, 28, 2006, NULL, NULL, 'Snakes! They\'re beautiful and they\'re scary. Some people like them, some people don\'t; but if you want to learn more about snakes, this is the book to read. Snake teeth, snake eyes, snake scales, and snake babies are all in this book, along with some really fun pictures to look at.', 'Snakes', NULL, NULL, NULL), -(2926, 2926, 'Judy Ellis,', NULL, '2020-07-18 19:54:32', '2022-09-22 02:26:03', 6, '', '', 'Phyllis Hornung', '1570911509', 9781570911507, 32, 2004, NULL, NULL, 'In ancient Greece, young Pythagoras discovers a special number pattern (the Pythagorean theorem) and uses it to solve problems involving right triangles.', 'What\'s Your Angle, Pythagoras?', NULL, NULL, NULL), +(2926, 2926, 'Judy Ellis,', NULL, '2020-07-18 19:54:32', '2022-09-22 02:26:03', 2, '', '', 'Phyllis Hornung', '1570911509', 9781570911507, 32, 2004, NULL, NULL, 'In ancient Greece, young Pythagoras discovers a special number pattern (the Pythagorean theorem) and uses it to solve problems involving right triangles.', 'What\'s Your Angle, Pythagoras?', NULL, NULL, NULL), (2927, 2927, 'Cindy Neuschwander', NULL, '2020-07-18 20:02:08', '2022-09-22 02:26:03', 6, '', '', 'Wayne Geehan', '1570917663', 9781570917660, 32, 2015, NULL, NULL, 'When Steward Edmund Rounds and Sir Cumference notice that there are strangers camped nearby, Rounds II decides to investigate despite being involved with the task of learning how to make accurate counts of the castle\'s stores of food, supplies, and weaponry. When he reports back that an enemy is lying in wait, everyone moves quickly to defend the castle. But wait! Will Rounds II be able to figure out how many bows and arrows they have to create an appropriate battle plan? Using rounding techniques to figure out the totals more quickly, Rounds II is just in time to help stave off a potentially disastrous attack. ', 'Sir Cumference and the Roundabout Battle', NULL, NULL, NULL), (2928, 6895, 'Mary Beth Leatherdale', NULL, '2020-07-18 20:20:06', '2020-07-18 20:20:06', 6, '', '', 'Eleanor Shakespeare', '1554518962', 9781554518968, 56, 2017, NULL, NULL, 'Five true stories, from 1939 to today, about young people who lived through the harrowing experience of setting sail in search of asylum: Ruth and her family board the St. Louis to escape Nazism; Phu sets out alone from war-torn Vietnam; José tries to reach the United States from Cuba; Najeeba fl es Afghanistan and the Taliban; and after losing his family, Mohamed abandons his village on the Ivory Coast in search of a new life. ', 'Stormy Seas', NULL, NULL, NULL), (2929, 2929, 'C Drew Lamm, David McCord, Rebecca Kai Dotlich, Anne LeMieux, Lee Bennett Hopkins, James Hayford, Patricia Hubbell, Brod Bagert, Charles Smith, Tom Robert Shields, Langston Hughes, Frank Asch, Kathryn Allen Ilitch, Prince Redcloud, Gary Snyder, Ruth Delong Peterson, Ruth Lechlitner, Carl Sandburg, Jon Swan, Barbara M. Hales, Lilian Moore, Myra Cohn Livingston, X.J. Kennedy, Kris Aro McLeod, Kaye Starbird, Dave Etter, Robert Francis, Fran Haraway, Aileen Fisher, Shonto Begay, April Halprin Wayland, Lillian M. Fisher, Douglas Florian, , Elizabeth Coatsworth, Joquin Miller, Tom Robert Shiel', NULL, '2020-07-18 20:48:47', '2020-07-21 13:14:10', 6, '', '', 'Stephen Alcorn', '0439372909', 9780439372909, 83, 2000, NULL, NULL, 'A collection of poems of seven geographical regions of the United States, including the Northeast, Southeast, Great Lakes, Plains, Mountain, Southwest, and Pacific Coast States.', 'My America A Poetry Atlas of the United States', NULL, NULL, NULL), @@ -6312,19 +6316,19 @@ INSERT INTO `books` (`id`, `story_id`, `author`, `cover_image`, `date_created`, (3074, 1702, 'Sofiya Pasternack', NULL, '2020-08-05 00:41:48', '2020-08-05 00:41:48', 2, '', '', '', '0000000000', 9780358379058, 394, 2019, 0, 0, 'In tenth-century Eastern Europe, headstrong eleven-year-old Anya is the daughter of the only Jewish family in her village. When her family’s livelihood is threatened by a bigoted magistrate, Anya is lured in by a friendly family of fools, who promise her money in exchange for helping them capture the last dragon in Kievan Rus. This seems easy enough until she finds out that the scary old dragon isn\'t as old—or as scary—as everyone thought. Now Anya is faced with a choice: save the dragon, or save her family.', 'Anya and the Dragon', NULL, NULL, NULL), (3075, 1968, 'Amanda Hocking', NULL, '2020-08-05 06:46:39', '2020-08-05 06:46:39', 2, '', '', '', '1250008115', 9781250005663, 342, 2013, 2013, 1, 'Gemma and Harper Fisher are facing the fight of their lives. Gemma has been cursed with extraordinary powers that have a terrifying dark side, but she\'s finally found what she needs―a way to break the curse and become human again. But finding the means to do it will be her greatest challenge yet. And now Penn, Lexi and Thea―the gorgeous but deadly creatures who cursed her―are determined to kill her before she has a chance. Making matters worse, Penn has her sights set on Daniel―the guy Harper loves―and Penn always gets what she wants.\r\n\r\nAs Gemma and Harper race to break the curse before it\'s too late, they\'re thrust deeper into a mythical world of immortal secrets. They must delve into their enemies\' past to find the answers they need, even if it means being drawn deeper into their savagely beautiful world. But one of the girls is not what she seems…and Gemma finds an unlikely ally as she struggles to save herself. But will it be enough to break an ancient curse that no one has ever escaped alive?', 'Tidal', NULL, NULL, NULL), (3076, 3076, 'John Reynolds Gardiner', NULL, '2020-08-05 12:52:26', '2022-09-22 02:26:02', 3, '', '', 'Marcia Sewall', '0439095107', 9780439095105, 83, 1999, 1980, 1, 'Little Willy has a big job to do. When his grandfather falls ill, it is up to Willy alone to save their farm from the tax collector. But where can a ten-year-old get five hundred dollars in a hurry? Then Willy sees the poster for the National Dogsled Race.\r\n\r\nThe race pits Willy against the best dog teams in the country, including the Indian Stone Fox and his five beautiful Samoyeds, who have never lost a race. And Stone Fox wants the prize money as badly as Willy does. Willy\'s dog, Searchlight, is every bit as fast as the competition, and Willy knows the terrain better than anyone. But can one boy and one dog be a match for the unbeatable Stone Fox?', 'Stone Fox', NULL, '', '0'), -(3077, 5965, 'J.K. Rowling', NULL, '2020-08-05 13:35:21', '2020-11-13 00:38:42', 6, '', '', 'Mary GrandPre', '059035342X', 9780590352427, 310, 1999, 1997, 2, 'Harry Potter\'s life is miserable. His parents are dead and he\'s stuck with his heartless relatives, who force him to live in a tiny closet under the stairs. But his fortune changes when he receives a letter that tells him the truth about himself: he\'s a wizard. A mysterious visitor rescues him from his relatives and takes him to his new home, Hogwarts School of Witchcraft and Wizardry. After a lifetime of bottling up his magical powers, Harry finally feels like a normal kid. But even within the Wizarding community, he is special. He is the boy who lived: the only person to have ever survived a killing curse inflicted by the evil Lord Voldemort, who launched a brutal takeover of the Wizarding world, only to vanish after failing to kill Harry. Though Harry\'s first year at Hogwarts is the best of his life, not everything is perfect. There is a dangerous secret object hidden within the castle walls, and Harry believes it\'s his responsibility to prevent it from falling into evil hands. But doing so will bring him into contact with forces more terrifying than he ever could have imagined.', 'Harry Potter and the Sorcerer\'s Stone', NULL, NULL, NULL), -(3078, 3201, 'J.K. Rowling', NULL, '2020-08-05 14:01:32', '2022-09-22 02:26:02', 3, '', '', 'Mary GrandPre', '054558292X', 9780545582926, 341, 2013, 1998, 2, 'The Dursleys were so mean and hideous that summer that all Harry Potter wanted was to get back to the Hogwarts School for Witchcraft and Wizardry. But just as he\'s packing his bags, Harry receives a warning from a strange, impish creature named Dobby who says that if Harry Potter returns to Hogwarts, disaster will strike.\r\nAnd strike it does. For in Harry\'s second year at Hogwarts, fresh torments and horrors arise, including an outrageously stuck-up new professor, Gilderoy Lockhart, a spirit named Moaning Myrtle who haunts the girls\' bathroom, and the unwanted attentions of Ron Weasley\'s younger sister, Ginny. But each of these seem minor annoyances when the real trouble begins, and someone, or something, starts turning Hogwarts students to stone. Could it be Draco Malfoy, a more poisonous rival than ever? Could it possibly be Hagrid, whose mysterious past is finally told? Or could it be the one everyone at Hogwarts most suspects: Harry Potter himself?', 'Harry Potter and the Chamber of Secrets', NULL, '', '0'), -(3079, 3079, 'J.K. Rowling', NULL, '2020-08-05 14:27:58', '2020-11-13 00:38:01', 6, '', '', 'Mary GrandPre', '0439136369', 9780439136365, 436, 2001, 1999, 1, 'Harry Potter\'s third year at Hogwarts is full of new dangers. A convicted murderer, Sirius Black, has broken out of Azkaban prison, and it seems he\'s after Harry. Now Hogwarts is being patrolled by the dementors, the Azkaban guards who are hunting Sirius. But Harry can\'t imagine that Sirius or, for that matter, the evil Lord Voldemort could be more frightening than the dementors themselves, who have the terrible power to fill anyone they come across with aching loneliness and despair. Meanwhile, life continues as usual at Hogwarts. A top-of-the-line broom takes Harry\'s success at Quidditch, the sport of the Wizarding world, to new heights. A cute fourth-year student catches his eye. And he becomes close with the new Defense of the Dark Arts teacher, who was a childhood friend of his father. Yet despite the relative safety of life at Hogwarts and the best efforts of the dementors, the threat of Sirius Black grows ever closer. But if Harry has learned anything from his education in wizardry, it is that things are often not what they seem. ', 'Harry Potter and the Prisoner of Azkaban', NULL, NULL, NULL), -(3080, 3080, 'J.K. Rowling', NULL, '2020-08-05 14:59:01', '2022-09-22 02:26:02', 6, '', '', 'Mary GrandPré', '0439139600', 9780439139601, 735, 2002, 2000, 1, 'Lord Voldemort, the dark wizard responsible for the deaths of Harry\'s parents, is growing stronger. At the Quidditch World Cup, Voldemort\'s signature Dark Mark appears in the sky over the stadium, causing pandemonium. The lightning-bolt-shaped scar on Harry\'s forehead is sporadically causing him agonizing pain, and he is also hearing disturbing voices. Harry realizes that all this is the result of a strong connection between himself and the Dark Lord, one that is putting him in grave danger. Back at Hogwarts, the students are getting ready for the upcoming Tri-wizard Tournament. Witches and wizards from two other schools are coming to Hogwarts for the year to compete in a series of grueling contests. The tournament is open only to students age 17 and above, but when someone secretly enters Harry\'s name, he is forced to compete. How can a 14-year-old possibly pass tests that might be fatal to an advanced wizard? And with the threat of Lord Voldemort looming, will he be able to focus on the tournament at all? For Harry, his friends, and everyone in the Wizarding world, the stakes are about to become much higher.', 'Harry Potter and the Goblet of Fire', NULL, '', '0'), -(3081, 2322, 'Rick Riordan', NULL, '2020-08-05 23:30:05', '2022-09-22 02:26:02', 89, '', '', '', '0545241200', 9780545241209, 376, 2006, 2005, 0, 'Percy Jackson is about to be kicked out of boarding school... again. And that\'s the least of his troubles. Lately, mythological monsters and the gods of Mount Olympus seem to be walking straight out of the pages of Percy\'s Greek mythology textbook and into his life. And worse, he\'s angered a few of them. Zeus\'s master lightning bolt has been stolen, and Percy is the prime suspect.\r\n\r\nNow Percy and his friends have just ten days to find and return Zeus\'s stolen property and bring peace to a warring Mount Olympus. But to succeed on his quest, Percy will have to do more than catch the true thief: he must come to terms with the father who abandoned him; solve the riddle of the Oracle, which warns him of betrayal by a friend; and unravel a treachery more powerful than the gods themselves.', 'The Lightning Thief', NULL, NULL, NULL), -(3082, 2323, 'Rick Riordan', NULL, '2020-08-05 23:41:16', '2020-08-05 23:54:33', 89, '', '', '', '0545057043', 9780545057042, 312, 2008, 2007, 0, 'When Percy Jackson receives an urgent distress call from his friend Grover, he immediately prepares for battle. He knows he\'ll need his powerful demigod allies at his side; his trusty bronze sword, Riptide; and... a ride from his mom.\r\n\r\nThe demigods race to the rescue to find that Grover has made an important discovery: two new powerful half-bloods, whose parentage is unknown. But that\'s not all that awaits them. The Titan lord, Kronos, has set up a devious trap, and the young heroes have just fallen prey.', 'The Titan\'s Curse', NULL, NULL, NULL), -(3083, 2311, 'Rick Riordan', NULL, '2020-08-05 23:45:29', '2020-08-05 23:57:11', 89, '', '', '', '0545174813', 9780545174817, 361, 2009, 2008, 0, 'Percy Jackson isn\'t expecting freshman orientation to be any fun. But when a mysterious mortal acquaintance appears on campus, followed by demon cheerleaders, things quickly move from bad to diabolical. \r\n\r\nTime is running out as war between the Olympians and the evil Titan lord Kronos draws near. Even the safe haven of Camp Half-Blood grows more vulnerable by the minute as Kronos\'s army prepares to invade its once impenetrable borders. To stop the invasion, Percy and his demigod friends must set out on a quest through the Labyrinth-- a sprawling underground world with stunning surprises at every turn. ', 'The Battle of the Labyrinth', NULL, NULL, NULL), -(3084, 3084, 'Samin Nosrat', NULL, '2020-08-05 23:52:36', '2020-09-15 03:06:58', 3, '', '', '', '1476753830', 9781476753836, 480, 2017, 2017, 1, 'Whether you\'ve never picked up a knife or you\'re an accomplished chef, there are only four basic factors that determine how good your food will taste. Salt, Fat, Acid, and Heat are the four cardinal directions of cooking, and they will guide you as you choose which ingredients to use and how to cook them, and they will tell you why last minute adjustments will ensure that food tastes exactly as it should. This book will change the way you think about cooking and eating, and help you find your bearings in any kitchen, with any ingredients, while cooking any meal. ', 'Salt, Fat, Acid, Heat', NULL, NULL, NULL), -(3085, 2314, 'Rick Riordan', NULL, '2020-08-05 23:53:49', '2022-09-22 02:26:02', 89, '', '', '', '0545272629', 9780545272629, 368, 2010, 2009, 0, 'PAll year the half-bloods have been preparing for battle against the Titans, knowing the odds of victory are grim. Kronos\'s army is stronger than ever, and with every god and half-blood he recruits, the evil Titan\'s power only grows.\r\n\r\nWhile the Olympians struggle to contain the rampaging monster Typhon, Kronos begins his advance on New York City, where Mount Olympus stands virtually unguarded. Now it\'s up to Percy Jackson and an army of young demigods to stop the Lord of Time. \r\n\r\nIn this momentous final book in the New York Times best-selling series, the long-awaited prophecy surrounding Percy\'s sixteenth birthday unfolds. And as the battle for Western civilization rages on the streets of Manhattan, Percy faces a terrifying suspicion that he may be fighting against his own fate.', 'Percy Jackson and the Last Olympian', NULL, NULL, NULL), -(3088, 3088, 'Gary Paulsen', NULL, '2020-08-06 17:38:24', '2022-09-22 02:26:02', 3, '', '', '', '0545462207', 9780545462204, 181, 2012, 1987, 0, 'Thirteen-year-old Brian Robeson is on his way to visit her father when the single-engine plane in which he is flying crashes. Suddenly, Brian finds himself alone in the Canadian wilderness with nothing but a tattered Windbreaker and the hatchet his mother gave his as a present-- and the dreadful secret that has been tearing him apart since his parents\' divorce. \r\n\r\nBut now Brian has no time for anger, self-pity, or despair-- it will take all his know-how and determination, and more courage than he knew he possessed to survive.', 'Hatchet', NULL, '', '0'), -(3089, 3089, 'Jerry Spinelli', NULL, '2020-08-06 17:47:37', '2022-09-22 02:26:02', 3, '', '', '', '0316028711', 9780316028714, 220, 2008, 2007, 0, 'Nine-year-old David has recently lost his mother to a freak accident, his salesman father is constantly on the road, and he is letting his anger out on his grandmother. Sarcastic and bossy 13-year-old Primrose lives with her childlike, fortuneteller mother, and a framed picture is the only evidence of the father she never knew. Despite their differences, David and Primrose forge a tight yet tumultuous friendship, eventually helping each other deal with what is missing in their lives.', 'Eggs', NULL, '', '0'), -(3090, 3090, 'Jerry Spinelli', NULL, '2020-08-06 17:53:37', '2020-08-06 17:54:52', 3, '', '', '', '0439444438', 0, 186, 2002, 2000, 0, 'Leo Borlock follows the unspoken rule at Mica Area High School: don\'t stand out--under any circumstances! Then Stargirl arrives at Mica High and everything changes--for Leo and for the entire school. After 15 years of homeschooling, Stargirl bursts into tenth grade in an explosion of color and a clatter of ukulele music, enchanting the Mica student body.\r\n\r\nBut the delicate scales of popularity suddenly shift, and Stargirl is shunned for everything that makes her different. Somewhere in the midst of Stargirl\'s arrival and rise and fall, normal Leo Borlock has tumbled into love with her.', 'Stargirl', NULL, NULL, NULL), -(3091, 3091, 'Katherine Paterson', NULL, '2020-08-07 01:49:15', '2020-08-07 01:49:15', 3, '', '', 'Donna Diamond', '0545003350', 9780545003353, 128, 2007, 1977, 0, 'Jess Aarons has been practicing all summer so he can be the fastest runner in the fifth grade. And he almost is, until the new girl in school, Leslie Burke, outpaces him. The two become fast friends and spend most days in the woods behind Leslie\'s house, where they invent an enchanted land called Terabithia. One morning, Leslie goes to Terabithia without Jess and a tragedy occurs. It will take the love of his family and the strength that Leslie has given him for Jess to be able to deal with his grief.', 'Bridge to Terabithia', NULL, NULL, NULL), +(3077, 5965, 'J.K. Rowling', NULL, '2020-08-05 13:35:21', '2020-11-13 00:38:42', 8, '', '', 'Mary GrandPre', '059035342X', 9780590352427, 310, 1999, 1997, 2, 'Harry Potter\'s life is miserable. His parents are dead and he\'s stuck with his heartless relatives, who force him to live in a tiny closet under the stairs. But his fortune changes when he receives a letter that tells him the truth about himself: he\'s a wizard. A mysterious visitor rescues him from his relatives and takes him to his new home, Hogwarts School of Witchcraft and Wizardry. After a lifetime of bottling up his magical powers, Harry finally feels like a normal kid. But even within the Wizarding community, he is special. He is the boy who lived: the only person to have ever survived a killing curse inflicted by the evil Lord Voldemort, who launched a brutal takeover of the Wizarding world, only to vanish after failing to kill Harry. Though Harry\'s first year at Hogwarts is the best of his life, not everything is perfect. There is a dangerous secret object hidden within the castle walls, and Harry believes it\'s his responsibility to prevent it from falling into evil hands. But doing so will bring him into contact with forces more terrifying than he ever could have imagined.', 'Harry Potter and the Sorcerer\'s Stone', NULL, NULL, NULL), +(3078, 3201, 'J.K. Rowling', NULL, '2020-08-05 14:01:32', '2022-09-22 02:26:02', 8, '', '', 'Mary GrandPre', '054558292X', 9780545582926, 341, 2013, 1998, 2, 'The Dursleys were so mean and hideous that summer that all Harry Potter wanted was to get back to the Hogwarts School for Witchcraft and Wizardry. But just as he\'s packing his bags, Harry receives a warning from a strange, impish creature named Dobby who says that if Harry Potter returns to Hogwarts, disaster will strike.\r\nAnd strike it does. For in Harry\'s second year at Hogwarts, fresh torments and horrors arise, including an outrageously stuck-up new professor, Gilderoy Lockhart, a spirit named Moaning Myrtle who haunts the girls\' bathroom, and the unwanted attentions of Ron Weasley\'s younger sister, Ginny. But each of these seem minor annoyances when the real trouble begins, and someone, or something, starts turning Hogwarts students to stone. Could it be Draco Malfoy, a more poisonous rival than ever? Could it possibly be Hagrid, whose mysterious past is finally told? Or could it be the one everyone at Hogwarts most suspects: Harry Potter himself?', 'Harry Potter and the Chamber of Secrets', NULL, '', '0'), +(3079, 3079, 'J.K. Rowling', NULL, '2020-08-05 14:27:58', '2020-11-13 00:38:01', 8, '', '', 'Mary GrandPre', '0439136369', 9780439136365, 436, 2001, 1999, 1, 'Harry Potter\'s third year at Hogwarts is full of new dangers. A convicted murderer, Sirius Black, has broken out of Azkaban prison, and it seems he\'s after Harry. Now Hogwarts is being patrolled by the dementors, the Azkaban guards who are hunting Sirius. But Harry can\'t imagine that Sirius or, for that matter, the evil Lord Voldemort could be more frightening than the dementors themselves, who have the terrible power to fill anyone they come across with aching loneliness and despair. Meanwhile, life continues as usual at Hogwarts. A top-of-the-line broom takes Harry\'s success at Quidditch, the sport of the Wizarding world, to new heights. A cute fourth-year student catches his eye. And he becomes close with the new Defense of the Dark Arts teacher, who was a childhood friend of his father. Yet despite the relative safety of life at Hogwarts and the best efforts of the dementors, the threat of Sirius Black grows ever closer. But if Harry has learned anything from his education in wizardry, it is that things are often not what they seem. ', 'Harry Potter and the Prisoner of Azkaban', NULL, NULL, NULL), +(3080, 3080, 'J.K. Rowling', NULL, '2020-08-05 14:59:01', '2022-09-22 02:26:02', 8, '', '', 'Mary GrandPré', '0439139600', 9780439139601, 735, 2002, 2000, 1, 'Lord Voldemort, the dark wizard responsible for the deaths of Harry\'s parents, is growing stronger. At the Quidditch World Cup, Voldemort\'s signature Dark Mark appears in the sky over the stadium, causing pandemonium. The lightning-bolt-shaped scar on Harry\'s forehead is sporadically causing him agonizing pain, and he is also hearing disturbing voices. Harry realizes that all this is the result of a strong connection between himself and the Dark Lord, one that is putting him in grave danger. Back at Hogwarts, the students are getting ready for the upcoming Tri-wizard Tournament. Witches and wizards from two other schools are coming to Hogwarts for the year to compete in a series of grueling contests. The tournament is open only to students age 17 and above, but when someone secretly enters Harry\'s name, he is forced to compete. How can a 14-year-old possibly pass tests that might be fatal to an advanced wizard? And with the threat of Lord Voldemort looming, will he be able to focus on the tournament at all? For Harry, his friends, and everyone in the Wizarding world, the stakes are about to become much higher.', 'Harry Potter and the Goblet of Fire', NULL, '', '0'), +(3081, 2322, 'Rick Riordan', NULL, '2020-08-05 23:30:05', '2022-09-22 02:26:02', 1, '', '', '', '0545241200', 9780545241209, 376, 2006, 2005, 0, 'Percy Jackson is about to be kicked out of boarding school... again. And that\'s the least of his troubles. Lately, mythological monsters and the gods of Mount Olympus seem to be walking straight out of the pages of Percy\'s Greek mythology textbook and into his life. And worse, he\'s angered a few of them. Zeus\'s master lightning bolt has been stolen, and Percy is the prime suspect.\r\n\r\nNow Percy and his friends have just ten days to find and return Zeus\'s stolen property and bring peace to a warring Mount Olympus. But to succeed on his quest, Percy will have to do more than catch the true thief: he must come to terms with the father who abandoned him; solve the riddle of the Oracle, which warns him of betrayal by a friend; and unravel a treachery more powerful than the gods themselves.', 'The Lightning Thief', NULL, NULL, NULL), +(3082, 2323, 'Rick Riordan', NULL, '2020-08-05 23:41:16', '2020-08-05 23:54:33', 1, '', '', '', '0545057043', 9780545057042, 312, 2008, 2007, 0, 'When Percy Jackson receives an urgent distress call from his friend Grover, he immediately prepares for battle. He knows he\'ll need his powerful demigod allies at his side; his trusty bronze sword, Riptide; and... a ride from his mom.\r\n\r\nThe demigods race to the rescue to find that Grover has made an important discovery: two new powerful half-bloods, whose parentage is unknown. But that\'s not all that awaits them. The Titan lord, Kronos, has set up a devious trap, and the young heroes have just fallen prey.', 'The Titan\'s Curse', NULL, NULL, NULL), +(3083, 2311, 'Rick Riordan', NULL, '2020-08-05 23:45:29', '2020-08-05 23:57:11', 1, '', '', '', '0545174813', 9780545174817, 361, 2009, 2008, 0, 'Percy Jackson isn\'t expecting freshman orientation to be any fun. But when a mysterious mortal acquaintance appears on campus, followed by demon cheerleaders, things quickly move from bad to diabolical. \r\n\r\nTime is running out as war between the Olympians and the evil Titan lord Kronos draws near. Even the safe haven of Camp Half-Blood grows more vulnerable by the minute as Kronos\'s army prepares to invade its once impenetrable borders. To stop the invasion, Percy and his demigod friends must set out on a quest through the Labyrinth-- a sprawling underground world with stunning surprises at every turn. ', 'The Battle of the Labyrinth', NULL, NULL, NULL), +(3084, 3084, 'Samin Nosrat', NULL, '2020-08-05 23:52:36', '2020-09-15 03:06:58', 1, '', '', '', '1476753830', 9781476753836, 480, 2017, 2017, 1, 'Whether you\'ve never picked up a knife or you\'re an accomplished chef, there are only four basic factors that determine how good your food will taste. Salt, Fat, Acid, and Heat are the four cardinal directions of cooking, and they will guide you as you choose which ingredients to use and how to cook them, and they will tell you why last minute adjustments will ensure that food tastes exactly as it should. This book will change the way you think about cooking and eating, and help you find your bearings in any kitchen, with any ingredients, while cooking any meal. ', 'Salt, Fat, Acid, Heat', NULL, NULL, NULL), +(3085, 2314, 'Rick Riordan', NULL, '2020-08-05 23:53:49', '2022-09-22 02:26:02', 1, '', '', '', '0545272629', 9780545272629, 368, 2010, 2009, 0, 'PAll year the half-bloods have been preparing for battle against the Titans, knowing the odds of victory are grim. Kronos\'s army is stronger than ever, and with every god and half-blood he recruits, the evil Titan\'s power only grows.\r\n\r\nWhile the Olympians struggle to contain the rampaging monster Typhon, Kronos begins his advance on New York City, where Mount Olympus stands virtually unguarded. Now it\'s up to Percy Jackson and an army of young demigods to stop the Lord of Time. \r\n\r\nIn this momentous final book in the New York Times best-selling series, the long-awaited prophecy surrounding Percy\'s sixteenth birthday unfolds. And as the battle for Western civilization rages on the streets of Manhattan, Percy faces a terrifying suspicion that he may be fighting against his own fate.', 'Percy Jackson and the Last Olympian', NULL, NULL, NULL), +(3088, 3088, 'Gary Paulsen', NULL, '2020-08-06 17:38:24', '2022-09-22 02:26:02', 8, '', '', '', '0545462207', 9780545462204, 181, 2012, 1987, 0, 'Thirteen-year-old Brian Robeson is on his way to visit her father when the single-engine plane in which he is flying crashes. Suddenly, Brian finds himself alone in the Canadian wilderness with nothing but a tattered Windbreaker and the hatchet his mother gave his as a present-- and the dreadful secret that has been tearing him apart since his parents\' divorce. \r\n\r\nBut now Brian has no time for anger, self-pity, or despair-- it will take all his know-how and determination, and more courage than he knew he possessed to survive.', 'Hatchet', NULL, '', '0'), +(3089, 3089, 'Jerry Spinelli', NULL, '2020-08-06 17:47:37', '2022-09-22 02:26:02', 8, '', '', '', '0316028711', 9780316028714, 220, 2008, 2007, 0, 'Nine-year-old David has recently lost his mother to a freak accident, his salesman father is constantly on the road, and he is letting his anger out on his grandmother. Sarcastic and bossy 13-year-old Primrose lives with her childlike, fortuneteller mother, and a framed picture is the only evidence of the father she never knew. Despite their differences, David and Primrose forge a tight yet tumultuous friendship, eventually helping each other deal with what is missing in their lives.', 'Eggs', NULL, '', '0'), +(3090, 3090, 'Jerry Spinelli', NULL, '2020-08-06 17:53:37', '2020-08-06 17:54:52', 8, '', '', '', '0439444438', 0, 186, 2002, 2000, 0, 'Leo Borlock follows the unspoken rule at Mica Area High School: don\'t stand out--under any circumstances! Then Stargirl arrives at Mica High and everything changes--for Leo and for the entire school. After 15 years of homeschooling, Stargirl bursts into tenth grade in an explosion of color and a clatter of ukulele music, enchanting the Mica student body.\r\n\r\nBut the delicate scales of popularity suddenly shift, and Stargirl is shunned for everything that makes her different. Somewhere in the midst of Stargirl\'s arrival and rise and fall, normal Leo Borlock has tumbled into love with her.', 'Stargirl', NULL, NULL, NULL), +(3091, 3091, 'Katherine Paterson', NULL, '2020-08-07 01:49:15', '2020-08-07 01:49:15', 8, '', '', 'Donna Diamond', '0545003350', 9780545003353, 128, 2007, 1977, 0, 'Jess Aarons has been practicing all summer so he can be the fastest runner in the fifth grade. And he almost is, until the new girl in school, Leslie Burke, outpaces him. The two become fast friends and spend most days in the woods behind Leslie\'s house, where they invent an enchanted land called Terabithia. One morning, Leslie goes to Terabithia without Jess and a tragedy occurs. It will take the love of his family and the strength that Leslie has given him for Jess to be able to deal with his grief.', 'Bridge to Terabithia', NULL, NULL, NULL), (3092, 3092, 'E.L. Konigsburg', NULL, '2020-08-07 02:04:14', '2020-08-07 02:04:14', 3, '', '', '', '1416906614', 9781416906612, 146, 2005, 1975, 0, 'THE GREATEST ARTIST OF HIS TIME\r\nAN APPRENTICE WITH A LARCENOUS HEART AND AN AVERSION TO THE TRUTH\r\nA YOUNG DUTCHESS WHOSE PLAIN FACE BELIES HER BEAUTIFUL SOUL\r\n\r\nCould the complex ways these three lives intertwine hold the key to a historical riddle as enigmatic as the Mona Lisa\'s smile -- why Leonardo da Vinci devoted three years to a painting of the second wife of an unimportant merchant when all the nobles of Europe were begging for a portrait by his hand?', 'The Second Mrs. Gioconda', NULL, NULL, NULL), (3093, 1991, 'Phyllis Reynolds Naylor', NULL, '2020-08-07 02:09:09', '2020-08-07 02:11:05', 3, '', '', '', '0439597528', 9780439597524, 137, 2003, 2000, 0, 'When Marty Preston comes across a young beagle in the hills behind his home, it is love at first sight—and also big trouble. It turns out the dog, which Marty names Shiloh, belongs to Judd Travers, who drinks too much and has a gun—and abuses his dogs. So when Shiloh runs away from Judd to Marty, Marty just has to hide him and protect him from Judd. But Marty\'s secret becomes too big for him to keep to himself, and it exposes his entire family to Judd\'s anger. How far will Marty have to go to make Shiloh his?', 'Shiloh', NULL, NULL, NULL), (3094, 3094, 'Jerry Spinelli', NULL, '2020-08-07 14:29:18', '2021-04-15 11:32:59', 3, '', '', '', '0439460794', 9780439460798, 218, 2003, 2002, 1, 'Just like other kids, Zinkoff rides his bike, hopes for snow days, and wants to be like his dad when he grows up. But Zinkoff also raises his hand with all the wrong answers, trips over his own feet, and falls down with laughter over a word like \"Jabip.\" Other kids have their own word to describe him, but Zinkoff is too busy to hear it. He doesn\'t know he\'s not like everyone else. And one winter night, Zinkoff\'s differences show that any name can someday become \"hero.\"', 'Loser', NULL, NULL, NULL), @@ -180661,6 +180665,21 @@ CREATE TABLE `logins` ( `passwordResetKey` varchar(50) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Global login for ALL users'; + +INSERT INTO `logins` (`id`, `email`, `first`, `last`) VALUES +(1, 'bk.reicher@gmail.com', 'Brian', 'Reicher'), +(2, 'dannyrollo4@gmail.com', 'Danny', 'Rollo'), +(3, '97.sharman@gmail.com', 'Narayan', 'Sharma'), +(4, 'andrewcaplan2020@gmail.com', 'Andrew', 'Caplan'), +(7, 'leshaigor@gmail.com', 'Leroy', 'Shaigorodsky'), +(8, 'alix.heudebourg@gmail.com', 'Alix', 'Heudebourg'), +(9, 'erin.furey2636@gmail.com', 'Erin', 'Furey'), +(10, 'amandakerr1000@gmail.com', 'Amanda', 'Kerr'), +(11, 'tiffanylee255@gmail.com', 'Tiffany', 'Lee'), +(11, 'therobkan@gmail.com', 'Robert', 'Kahn'), +(12, 'emmanuel.s.hong@gmail.com', 'Emmanuel', 'Heudebourg'); + + -- -------------------------------------------------------- -- diff --git a/remo-backend/src/model/model.go b/remo-backend/src/model/model.go new file mode 100644 index 0000000..e183d62 --- /dev/null +++ b/remo-backend/src/model/model.go @@ -0,0 +1,131 @@ +package model + +import ( + "database/sql" + + _ "github.com/go-sql-driver/mysql" +) + +type MsModel struct { + Conn *sql.DB +} + +type Model interface { + Book(string) Book + AllBooks() []Book + UserBooks(string) []Book + CheckoutBook(string, string) error + ReturnBookByID(string) error + UserByEmail(string) (User, error) + UserByID(string) User + AddBooks(Book) (Book, error) + AddUser(User) (User, error) + AddOnboardingQuestions(string, OnboardingQuestions) error + CheckOnboarded(string) (string, error) +} + +func (m *MsModel) Book(id string) Book { + book, err := GetBooksFromDB(m.Conn, id) + + if err != nil { + panic(err) + } + + return book +} +func (m *MsModel) UserBooks(id string) []Book { + books, err := GetUserBooksFromDB(m.Conn, id) + + if err != nil { + panic(err) + } + + return books +} + +func (m *MsModel) AllBooks() []Book { + books, err := GetAllBooksFromDB(m.Conn) + + if err != nil { + panic(err) + } + + return books +} + +func (m *MsModel) UserByEmail(email string) (User, error) { + user, err := GetUserByEmail(m.Conn, email) + + if err != nil { + return User{}, err + } + + return user, err +} + +func (m *MsModel) UserByID(id string) User { + user, err := GetUserByID(m.Conn, id) + + if err != nil { + panic(err) + } + + return user +} + +func (m *MsModel) AddBooks(book Book) (Book, error) { + err := WriteBooksToDb(m.Conn, book) + + if err != nil { + return Book{}, err + } + + return book, nil +} + +func (m *MsModel) AddUser(usr User) (User, error) { + err := InsertUser(m.Conn, usr) + + if err != nil { + return User{}, err + } + + return usr, nil +} + +func (m *MsModel) CheckoutBook(usr string, isbn_13 string) error { + err := CheckoutBook(m.Conn, usr, isbn_13) + + if err != nil { + return err + } + return nil +} + +func (m *MsModel) ReturnBookByID(isbn_13 string) error { + err := ReturnBook(m.Conn, isbn_13) + + if err != nil { + return err + } + return nil +} + +func (m *MsModel) AddOnboardingQuestions(user_id string, questions OnboardingQuestions) error { + err := InsertOnboardingQuestions(m.Conn, user_id, questions) + + if err != nil { + return err + } + + return nil +} + +func (m *MsModel) CheckOnboarded(id string) (string, error) { + check, err := GetOnboarded(m.Conn, id) + if err != nil { + return check, err + } + + return check, err +} diff --git a/remo-backend/src/model/transactions.go b/remo-backend/src/model/transactions.go new file mode 100644 index 0000000..e884413 --- /dev/null +++ b/remo-backend/src/model/transactions.go @@ -0,0 +1,172 @@ +package model + +import ( + "database/sql" + "fmt" + "strconv" +) + +func WriteBooksToDb(pool *sql.DB, book Book) error { + var new_id int + id, e := pool.Exec("SELECT COUNT(id) FROM books;") + if e != nil { + panic(e) + } + if result, ok := id.(sql.Result); ok { + count64, e2 := result.RowsAffected() + if e2 != nil { + panic(e2) + } + new_id = int(count64) + 1 + } + + _, err := pool.Exec(fmt.Sprintf("INSERT INTO books (id, title, author, isbn_13, isbn_10) VALUES ('%s', '%s', '%s', '%s', '%s');", strconv.Itoa(new_id), book.Title, book.Author, book.ISBN_13, book.ISBN_10)) + + return err +} + +func GetBooksFromDB(pool *sql.DB, isbn_13 string) (Book, error) { + book := Book{ + ISBN_13: isbn_13, + } + + err := pool.QueryRow(fmt.Sprintf("SELECT id, title, author, isbn_10, pub_date, num_pages, synopsis FROM books WHERE isbn_13= '%s';", isbn_13)).Scan(&book.BookId, &book.Title, &book.Author, &book.ISBN_10, &book.PublishDate, &book.PageCount, &book.Synopsis) + + if err != nil { + return Book{}, nil + // panic(err) + } + + return book, nil +} + +func GetUserBooksFromDB(pool *sql.DB, user_id string) ([]Book, error) { + rows, err := pool.Query("SELECT id, title, author, isbn_10, isbn_13, num_pages, synopsis FROM books where default_user_id='" + user_id + "' LIMIT 10;") + + if err != nil { + return nil, err + } + defer rows.Close() + + var books []Book + + for rows.Next() { + book := Book{} + err := rows.Scan(&book.BookId, &book.Title, &book.Author, &book.ISBN_10, &book.ISBN_13, &book.PageCount, &book.Synopsis) + if err != nil { + return nil, err + } + books = append(books, book) + } + + if err = rows.Err(); err != nil { + return []Book{}, nil + } + + return books, nil +} + +func GetAllBooksFromDB(pool *sql.DB) ([]Book, error) { + rows, err := pool.Query("SELECT id, title, author, isbn_10, isbn_13, num_pages, synopsis FROM books;") + + if err != nil { + return nil, err + } + defer rows.Close() + + var books []Book + + for rows.Next() { + book := Book{} + err := rows.Scan(&book.BookId, &book.Title, &book.Author, &book.ISBN_10, &book.ISBN_13, &book.PageCount, &book.Synopsis) + if err != nil { + return nil, err + } + books = append(books, book) + } + + if err = rows.Err(); err != nil { + return []Book{}, nil + } + + return books, nil +} +func InsertUser(pool *sql.DB, usr User) error { + _, err := pool.Exec(fmt.Sprintf("INSERT INTO logins (id, first, last, email) VALUES ('%s','%s','%s', '%s');", strconv.Itoa(usr.ID), usr.FirstName, usr.LastName, usr.Email)) + + return err +} + +func GetUserByEmail(pool *sql.DB, user_email string) (User, error) { + user := User{ + Email: user_email, + } + + err := pool.QueryRow(fmt.Sprintf("SELECT id, first, last FROM logins where email = '%s';", user_email)).Scan(&user.ID, &user.FirstName, &user.LastName) + + if err != nil { + return User{FirstName: "Invalid"}, nil + } + + return user, nil +} + +func GetUserByID(pool *sql.DB, user_ID string) (User, error) { + id, _ := strconv.Atoi(user_ID) + user := User{ + ID: id, + } + + err := pool.QueryRow(fmt.Sprintf("SELECT first, last, email FROM logins where ID = '%s';", user_ID)).Scan(&user.FirstName, &user.LastName, &user.Email) + + if err != nil { + return User{}, nil + } + + return user, nil +} + +func CheckoutBook(pool *sql.DB, user_ID string, isbn_13 string) error { + // book := Book{} + // // logic for checking if a book is already checked out + // check_err := pool.QueryRow(fmt.Sprintf("SELECT default_user_id FROM books where isbn_13 = '%s';", isbn_13)).Scan(&book.UserID) + // if check_err != nil { + // return check_err + // } + // if book.UserID != "1" { + // return check_err + // } + + _, err := pool.Exec(fmt.Sprintf("UPDATE books SET default_user_id = '%s' WHERE isbn_13 = '%s'", user_ID, isbn_13)) + + if err != nil { + return err + } + return nil +} + +func ReturnBook(pool *sql.DB, isbn_13 string) error { + _, err := pool.Exec(fmt.Sprintf("UPDATE books SET default_user_id = '-1' WHERE isbn_13 = '%s'", isbn_13)) + + if err != nil { + return err + } + return nil +} + +func InsertOnboardingQuestions(pool *sql.DB, user_id string, questions OnboardingQuestions) error { + _, err := pool.Exec(fmt.Sprintf("INSERT INTO onboarding_questions (user_id, q1, q2, q3, q4, q5, q6, q7, q8, submitted) VALUES ('%s','%s','%s', '%s', '%s','%s','%s', '%s', '%s', '1');", user_id, questions.Q1, questions.Q2, questions.Q3, questions.Q4, questions.Q5, questions.Q6, questions.Q7, questions.Q8)) + return err +} + +func GetOnboarded(pool *sql.DB, user_id string) (string, error) { + questions := OnboardingQuestions{} + + err := pool.QueryRow(fmt.Sprintf("SELECT submitted FROM onboarding_questions where user_id = '%s';", user_id)).Scan(&questions.Onboarded) + + if err != nil { + return "not onboarded", err + } + + return "onboarded", nil +} diff --git a/remo-backend/src/model/types.go b/remo-backend/src/model/types.go new file mode 100644 index 0000000..d10efe8 --- /dev/null +++ b/remo-backend/src/model/types.go @@ -0,0 +1,42 @@ +package model + +type Book struct { + BookId string `json:"id" db:"id"` + Title string `json:"title" db:"title"` + Author string `json:"author" db:"author"` + ISBN_13 string `json:"isbn_13" db:"isbn_13"` + ISBN_10 string `json:"isbn_10" db:"isbn_10"` + Subtitle string `json:"subtitle" db:"sub_title"` + PublishDate string `json:"publish_date" db:"pub_date"` + PageCount string `json:"page_count" db:"num_pages"` + Synopsis string `json:"synopsis" db:"synopsis"` + UserID string `json:"user_id" db:"default_user_id"` +} + +type User struct { + ID int `json:"id"` + FirstName string `json:"first_name"` + LastName string `json:"last_name"` + Email string `json:"email"` +} + +type LoginInfo struct { + Credential string `json:"credential"` + Email string `json:"email"` + FirstName string `json:"first"` + LastName string `json:"last"` + Picture string `json:"picture"` + ID string `json:"id"` +} + +type OnboardingQuestions struct { + Q1 string `json:"q1"` + Q2 string `json:"q2"` + Q3 string `json:"q3"` + Q4 string `json:"q4"` + Q5 string `json:"q5"` + Q6 string `json:"q6"` + Q7 string `json:"q7"` + Q8 string `json:"q8"` + Onboarded string `json:"onboarded"` +} diff --git a/remo-backend/src/services/users_service.go b/remo-backend/src/services/users_service.go deleted file mode 100644 index 42c328a..0000000 --- a/remo-backend/src/services/users_service.go +++ /dev/null @@ -1,53 +0,0 @@ -package services - -import ( - "remo/backend/src/domain/users" - errors "remo/backend/src/utils" - - "golang.org/x/crypto/bcrypt" -) - -func CreateUser(user users.User) (*users.User, *errors.RestErr) { - if err := user.Validate(); err != nil { - return nil, err - } - - // encrpyt the password - pwSlice, err := bcrypt.GenerateFromPassword([]byte(user.Password), 14) - if err != nil { - return nil, errors.NewBadRequestError(("failed to encrypt the password")) - } - - user.Password = string(pwSlice[:]) - - if err := user.Save(); err != nil { - return nil, err - } - - return &user, nil - -} - -func GetUser(user users.User) (*users.User, *errors.RestErr) { - result := &users.User{Email: user.Email} - - if err := result.GetByEmail(); err != nil { - return nil, err - } - - if err := bcrypt.CompareHashAndPassword([]byte(result.Password), []byte(user.Password)); err != nil { - return nil, errors.NewBadRequestError("failed to decrypt the password") - } - - resultWp := &users.User{ID: result.ID, FirstName: result.FirstName, LastName: result.LastName, Email: result.Email} - return resultWp, nil -} - -func GetUserByID(userId int64) (*users.User, *errors.RestErr) { - result := &users.User{ID: userId} - - if err := result.GetByID(); err != nil { - return nil, err - } - return result, nil -} diff --git a/remo-backend/tests/api_test.go b/remo-backend/tests/api_test.go index 8224b52..84b5161 100644 --- a/remo-backend/tests/api_test.go +++ b/remo-backend/tests/api_test.go @@ -1,37 +1,205 @@ package main import ( + "database/sql" + "encoding/json" + "fmt" "net/http" "net/http/httptest" - e "remo/backend/src/endpoints" + "os" + c "remo/backend/src/controller" + "remo/backend/src/model" "testing" "github.com/huandu/go-assert" ) func TestGetBooks(t *testing.T) { - router := e.Serve() + conn, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + os.Exit(1) + } + + defer conn.Close() + + m := &model.MsModel{ + Conn: conn, + } + c := &c.MsController{ + Model: m, + } + router := c.Serve() + + w := httptest.NewRecorder() + + req, _ := http.NewRequest("GET", "/v1/books/9780786838653", nil) + + router.ServeHTTP(w, req) + + assert.Equal(t, 200, w.Code) + + var books model.Book + + if e := json.Unmarshal(w.Body.Bytes(), &books); e != nil { + panic(err) + } + + test_book := model.Book{ + BookId: "3757", + Title: "Percy Jackson and the Olympians", + Author: "Rick Riordan", + ISBN_13: "9780786838653", + ISBN_10: "0786838655", + Subtitle: "", + PublishDate: "2006", + PageCount: "375", + Synopsis: "Percy Jackson is a good kid, but he can't seem to focus on his schoolwork or control his temper. And lately, being away at boarding school is only getting worse-Percy could have sworn his pre-algebra teacher turned into a monster and tried to kill him. When Percy's mom finds out, she knows it's time that he knew the truth about where he came from, and that he go to the one place he'll be safe. She sends Percy to Camp Half Blood, a summer camp for demigods (on Long Island), where he learns that the father he never knew is Poseidon, God of the Sea. Soon a mystery unfolds and together with his friends -- one a satyr and the other the demigod daughter of Athena -- Percy sets out on a quest across the United States to reach the gates of the Underworld (located in a recording studio in Hollywood) and prevent a catastrophic war between the gods.", + } + assert.Equal(t, test_book, books) +} + +func TestGetUserByID(t *testing.T) { + conn, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + os.Exit(1) + } + + defer conn.Close() + + m := &model.MsModel{ + Conn: conn, + } + c := &c.MsController{ + Model: m, + } + router := c.Serve() + + w := httptest.NewRecorder() + + req, _ := http.NewRequest("GET", "/v1/user/2", nil) + + router.ServeHTTP(w, req) + + assert.Equal(t, 200, w.Code) + + var user model.User + + if e := json.Unmarshal(w.Body.Bytes(), &user); e != nil { + panic(err) + } + + test_user := model.User{ + ID: 2, + FirstName: "Danny", + LastName: "Rollo", + Email: "dannyrollo4@gmail.com", + } + assert.Equal(t, test_user, user) +} + +func TestBadUser(t *testing.T) { + conn, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + os.Exit(1) + } + + defer conn.Close() + + m := &model.MsModel{ + Conn: conn, + } + c := &c.MsController{ + Model: m, + } + router := c.Serve() w := httptest.NewRecorder() - req, _ := http.NewRequest("GET", "/v1/books", nil) + req, _ := http.NewRequest("GET", "/v1/user/17", nil) + router.ServeHTTP(w, req) assert.Equal(t, 200, w.Code) - // var books []e.Book + var user model.User + + if e := json.Unmarshal(w.Body.Bytes(), &user); e != nil { + panic(err) + } + + test_user := model.User{} + assert.Equal(t, test_user, user) +} + +func TestCheckout(t *testing.T) { + conn, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") + if err != nil { + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + os.Exit(1) + } + + defer conn.Close() - // err := json.Unmarshal(w.Body.Bytes(), &books) + m := &model.MsModel{ + Conn: conn, + } + c := &c.MsController{ + Model: m, + } + router := c.Serve() + + w := httptest.NewRecorder() - // if err != nil { - // panic(err) - // } + req, _ := http.NewRequest("PUT", "/v1/checkout_book/1249898899889/1", nil) - // assert.Equal(t, []e.Book{ - // { - // BookId: "1", - // Title: "test", - // Author: "test-author", - // }, - // }, books) + router.ServeHTTP(w, req) + + assert.Equal(t, 200, w.Code) + + var isbn_13 string + + if e := json.Unmarshal(w.Body.Bytes(), &isbn_13); e != nil { + panic(err) + } + + test_isbn := "1249898899889" + assert.Equal(t, test_isbn, isbn_13) } + +// func TestReturn(t *testing.T) { +// conn, err := sql.Open("mysql", "remo:pwd@tcp(localhost:3333)/remodb") +// if err != nil { +// fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) +// os.Exit(1) +// } + +// defer conn.Close() + +// m := &model.MsModel{ +// Conn: conn, +// } +// c := &c.MsController{ +// Model: m, +// } +// router := c.Serve() + +// w := httptest.NewRecorder() + +// req, _ := http.NewRequest("PUT", "/v1/return_book/1249898899889", nil) + +// router.ServeHTTP(w, req) + +// assert.Equal(t, 200, w.Code) + +// var isbn_13 string + +// if e := json.Unmarshal(w.Body.Bytes(), &isbn_13); e != nil { +// panic(err) +// } + +// test_isbn := "1249898899889" +// assert.Equal(t, test_isbn, isbn_13) +// } diff --git a/remo-client/.eslintrc 2.js b/remo-client/.eslintrc 2.js new file mode 100644 index 0000000..40c6dcd --- /dev/null +++ b/remo-client/.eslintrc 2.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +}; diff --git a/remo-client/.node-version 2 b/remo-client/.node-version 2 new file mode 100644 index 0000000..b6a7d89 --- /dev/null +++ b/remo-client/.node-version 2 @@ -0,0 +1 @@ +16 diff --git a/remo-client/.prettierrc 2.js b/remo-client/.prettierrc 2.js new file mode 100644 index 0000000..2b54074 --- /dev/null +++ b/remo-client/.prettierrc 2.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/remo-client/.ruby-version 2 b/remo-client/.ruby-version 2 new file mode 100644 index 0000000..94ff29c --- /dev/null +++ b/remo-client/.ruby-version 2 @@ -0,0 +1 @@ +3.1.1 diff --git a/remo-client/.watchmanconfig 2 b/remo-client/.watchmanconfig 2 new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/remo-client/.watchmanconfig 2 @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/remo-client/Gemfile 2 b/remo-client/Gemfile 2 new file mode 100644 index 0000000..567e598 --- /dev/null +++ b/remo-client/Gemfile 2 @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version +ruby File.read(File.join(__dir__, '.ruby-version')).strip + +gem 'cocoapods', '~> 1.11', '>= 1.11.3' diff --git a/remo-client/README 2.md b/remo-client/README 2.md new file mode 100644 index 0000000..3113f08 --- /dev/null +++ b/remo-client/README 2.md @@ -0,0 +1,29 @@ +# Frontend Installs & Learning References + + +### Installations +[Installing Node](https://nodejs.org/en/download/) + +[Installing the React Native Development Environment](https://reactnative.dev/docs/environment-setup) + + + +### Learning References + +#### React Native +[React Native Documentation](https://github.com/reactnative.dev/docs/getting-started) + +[React Native in Action (book)](https://learning.oreilly.com/library/view/react-native-in/9781617294051/) + +[Professional React Native](https://learning.oreilly.com/library/view/professional-react-native/9781800563681/) + +#### TypeScript +[TypeScript Documentation](https://www.typescriptlang.org/docs/) + +[TypeScript for Java Devs](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes-oop.html) + +[TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html) + +[Learning TypeScript (book)](https://learning.oreilly.com/library/view/learning-typescript/9781098110321/) + +[Programming TypeScript (book)](https://learning.oreilly.com/library/view/programming-typescript/9781492037644/) \ No newline at end of file diff --git a/remo-client/android/build 2.gradle b/remo-client/android/build 2.gradle new file mode 100644 index 0000000..67d887b --- /dev/null +++ b/remo-client/android/build 2.gradle @@ -0,0 +1,21 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + ext { + buildToolsVersion = "33.0.0" + minSdkVersion = 21 + compileSdkVersion = 33 + targetSdkVersion = 33 + + // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. + ndkVersion = "23.1.7779620" + } + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:7.3.1") + classpath("com.facebook.react:react-native-gradle-plugin") + } +} diff --git a/remo-client/android/gradle 2.properties b/remo-client/android/gradle 2.properties new file mode 100644 index 0000000..e4af465 --- /dev/null +++ b/remo-client/android/gradle 2.properties @@ -0,0 +1,44 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m +org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true + +# Version of flipper SDK to use with React Native +FLIPPER_VERSION=0.125.0 + +# Use this property to specify which architecture you want to build. +# You can also override it from the CLI using +# ./gradlew -PreactNativeArchitectures=x86_64 +reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 + +# Use this property to enable support to the new architecture. +# This will allow you to use TurboModules and the Fabric render in +# your application. You should enable this flag either if you want +# to write custom TurboModules/Fabric components OR use libraries that +# are providing them. +newArchEnabled=false + +# Use this property to enable or disable the Hermes JS engine. +# If set to false, you will be using JSC instead. +hermesEnabled=true diff --git a/remo-client/android/gradlew 2 b/remo-client/android/gradlew 2 new file mode 100755 index 0000000..1b6c787 --- /dev/null +++ b/remo-client/android/gradlew 2 @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/remo-client/android/gradlew 2.bat b/remo-client/android/gradlew 2.bat new file mode 100644 index 0000000..ac1b06f --- /dev/null +++ b/remo-client/android/gradlew 2.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/remo-client/android/settings 2.gradle b/remo-client/android/settings 2.gradle new file mode 100644 index 0000000..7d64482 --- /dev/null +++ b/remo-client/android/settings 2.gradle @@ -0,0 +1,4 @@ +rootProject.name = 'remo' +apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) +include ':app' +includeBuild('../node_modules/react-native-gradle-plugin') diff --git a/remo-client/index 2.js b/remo-client/index 2.js new file mode 100644 index 0000000..a850d03 --- /dev/null +++ b/remo-client/index 2.js @@ -0,0 +1,9 @@ +/** + * @format + */ + +import {AppRegistry} from 'react-native'; +import App from './App'; +import {name as appName} from './app.json'; + +AppRegistry.registerComponent(appName, () => App); diff --git a/remo-ml/.DS_Store b/remo-ml/.DS_Store new file mode 100644 index 0000000..a38f13a Binary files /dev/null and b/remo-ml/.DS_Store differ diff --git a/remo-ml/src/coverscan/prediction_engine 2.py b/remo-ml/src/coverscan/prediction_engine 2.py new file mode 100644 index 0000000..90b22c3 --- /dev/null +++ b/remo-ml/src/coverscan/prediction_engine 2.py @@ -0,0 +1,32 @@ +import nltk +from collections import Counter +from itertools import combinations +from operator import mul +from functools import reduce + + +class PredictTitle(): + def __init__(self, words) -> None: + self.words = words + self.freqs = None + + def load_corpus_freqs(self): + # Load a corpus of text + nltk.download('webtext') + corpus = nltk.corpus.webtext.words() + + # Count the frequency of each word in the corpus + self.freqs: Counter = Counter(corpus) + + def most_likely_combos(self, num_combos = 5) -> dict: + # Generate sall combinations of the candidate words + combos: list = list(combinations(self.words, len(self.words))) + # Calculate a score for each combination + scores: dict = {} + for c in combos: + score = reduce(mul, [self.freqs[w] for w in c], 1) + scores[c] = score + + # Select the combination with the highest score + return sorted(scores, key=scores.get)[:num_combos] +w \ No newline at end of file diff --git a/remo-ml/src/coverscan/prediction_engine.py b/remo-ml/src/coverscan/prediction_engine.py new file mode 100644 index 0000000..90b22c3 --- /dev/null +++ b/remo-ml/src/coverscan/prediction_engine.py @@ -0,0 +1,32 @@ +import nltk +from collections import Counter +from itertools import combinations +from operator import mul +from functools import reduce + + +class PredictTitle(): + def __init__(self, words) -> None: + self.words = words + self.freqs = None + + def load_corpus_freqs(self): + # Load a corpus of text + nltk.download('webtext') + corpus = nltk.corpus.webtext.words() + + # Count the frequency of each word in the corpus + self.freqs: Counter = Counter(corpus) + + def most_likely_combos(self, num_combos = 5) -> dict: + # Generate sall combinations of the candidate words + combos: list = list(combinations(self.words, len(self.words))) + # Calculate a score for each combination + scores: dict = {} + for c in combos: + score = reduce(mul, [self.freqs[w] for w in c], 1) + scores[c] = score + + # Select the combination with the highest score + return sorted(scores, key=scores.get)[:num_combos] +w \ No newline at end of file