diff --git a/go.sum b/go.sum index 78ccfbdc..157e6ab1 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= -cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= cloud.google.com/go/bigquery v1.57.1 h1:FiULdbbzUxWD0Y4ZGPSVCDLvqRSyCIO6zKV7E2nf5uA= @@ -9,14 +7,12 @@ cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiV cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/datacatalog v1.18.3 h1:zmdxP6nOjN5Qb1rtu9h4kbEVwerQ6Oshf+t747QJUew= -cloud.google.com/go/datacatalog v1.18.3/go.mod h1:5FR6ZIF8RZrtml0VUao22FxhdjkoG+a0866rEnObryM= +cloud.google.com/go/datacatalog v1.19.0 h1:rbYNmHwvAOOwnW2FPXYkaK3Mf1MmGqRzK0mMiIEyLdo= +cloud.google.com/go/datacatalog v1.19.0/go.mod h1:5FR6ZIF8RZrtml0VUao22FxhdjkoG+a0866rEnObryM= cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg= cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= -cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w= -cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= @@ -82,6 +78,8 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8= github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/coreos/go-oidc/v3 v3.8.0 h1:s3e30r6VEl3/M7DTSCEuImmrfu1/1WBgA0cXkdzkrAY= @@ -114,6 +112,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -194,8 +194,6 @@ github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= @@ -375,8 +373,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= github.com/vektah/gqlparser v1.3.1/go.mod h1:bkVf0FX+Stjg/MHnm8mEyubuaArhNEqfQhF+OTiAL74= @@ -412,14 +410,12 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -432,8 +428,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -462,13 +456,9 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -500,8 +490,6 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -533,14 +521,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -google.golang.org/api v0.152.0 h1:t0r1vPnfMc260S2Ci+en7kfCZaLOPs5KI0sVV/6jZrY= -google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -551,16 +535,10 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -569,8 +547,6 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/pkg/api/router.go b/pkg/api/router.go index 84beec5b..ed075b05 100644 --- a/pkg/api/router.go +++ b/pkg/api/router.go @@ -1,6 +1,10 @@ package api import ( + "bytes" + "encoding/json" + "fmt" + "io/ioutil" "net/http" "github.com/99designs/gqlgen/graphql/handler" @@ -25,6 +29,34 @@ type HTTPAPI interface { Logout(w http.ResponseWriter, r *http.Request) } +type graphqlRequest struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` +} + +func logMW(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + body, err := ioutil.ReadAll(r.Body) + if err != nil { + http.Error(w, "cannot read body", http.StatusBadRequest) + return + } + + r.Body = ioutil.NopCloser(bytes.NewBuffer(body)) + + var req graphqlRequest + if err := json.Unmarshal(body, &req); err != nil { + http.Error(w, "cannot unmarshal body", http.StatusBadRequest) + return + } + + fmt.Printf("GraphQL Query: %v, Variables: %v\n", req.Query, req.Variables) + + // Call the next handler + next.ServeHTTP(w, r) + }) +} + func New( repo *database.Repo, gcsClient *gcs.Client, @@ -49,7 +81,7 @@ func New( router.Use(corsMW) router.Route("/api", func(r chi.Router) { r.Handle("/", playground.Handler("GraphQL playground", "/api/query")) - r.Handle("/query", authMW(gqlServer)) + r.Handle("/query", logMW((gqlServer))) r.HandleFunc("/login", httpAPI.Login) r.HandleFunc("/oauth2/callback", httpAPI.Callback) r.HandleFunc("/logout", httpAPI.Logout) diff --git a/pkg/database/dataproducts.go b/pkg/database/dataproducts.go index 3d67a9f5..ef42f356 100644 --- a/pkg/database/dataproducts.go +++ b/pkg/database/dataproducts.go @@ -3,7 +3,9 @@ package database import ( "context" "database/sql" + "encoding/json" "fmt" + "os" "github.com/google/uuid" "github.com/navikt/nada-backend/pkg/auth" @@ -164,6 +166,15 @@ func (r *Repo) DataproductGroupStats(ctx context.Context, limit, offset int) ([] return ret, nil } +func (r *Repo) GetDataproductComplete(ctx context.Context, id uuid.UUID) (*models.DataproductComplete, error) { + sqldp, err := r.querier.GetDataproductComplete(ctx, id) + if err != nil { + return nil, err + } + + return dataproductCompleteFromSQL(sqldp) +} + func dataproductFromSQL(dp gensql.Dataproduct) *models.Dataproduct { return &models.Dataproduct{ ID: dp.ID, @@ -180,3 +191,156 @@ func dataproductFromSQL(dp gensql.Dataproduct) *models.Dataproduct { }, } } + +func dataproductCompleteFromSQL(dprows []gensql.GetDataproductCompleteRow) (*models.DataproductComplete, error) { + dp := models.Dataproduct{ + ID: dprows[0].ID, + Name: dprows[0].Name, + Created: dprows[0].Created, + LastModified: dprows[0].LastModified, + Description: nullStringToPtr(dprows[0].Description), + Slug: dprows[0].Slug, + Owner: &models.Owner{ + Group: dprows[0].Group, + TeamkatalogenURL: nullStringToPtr(dprows[0].TeamkatalogenUrl), + TeamContact: nullStringToPtr(dprows[0].TeamContact), + TeamID: nullStringToPtr(dprows[0].TeamID), + }, + } + + datasets := []*models.DatasetComplete{} + for _, dprow := range dprows { + if dprow.DsID.UUID == uuid.Nil { + continue + } + + piiTags := "{}" + if dprow.PiiTags.RawMessage != nil { + piiTags = string(dprow.PiiTags.RawMessage) + } + + var ds *models.DatasetComplete + + for _, dsIn := range datasets { + if dsIn.ID == dprow.DsID.UUID { + ds = dsIn + fmt.Println("found") + break + } + } + if ds == nil { + ds = &models.DatasetComplete{ + Dataset: models.Dataset{ + ID: dprow.DsID.UUID, + Name: dprow.DsName.String, + Created: dprow.DsrcCreated, + LastModified: dprow.DsrcLastModified, + Description: nullStringToPtr(dprow.DsDescription), + Slug: dprow.DsSlug.String, + Keywords: dprow.Keywords, + DataproductID: dp.ID, + }, + Owner: dp.Owner, + Mappings: []models.MappingService{}, + Access: []*models.Access{}, + Services: &models.DatasetServices{}, + } + datasets = append(datasets, ds) + } + + if dprow.DsrcID != uuid.Nil { + var schema []*models.TableColumn + if dprow.DsrcSchema.Valid { + if err := json.Unmarshal(dprow.DsrcSchema.RawMessage, &schema); err != nil { + return nil, fmt.Errorf("unmarshalling schema: %w", err) + } + } + + dsrc := models.BigQueryComplete{ + BigQuery: models.BigQuery{ + ID: dprow.DsrcID, + DatasetID: dprow.DsID.UUID, + ProjectID: dprow.ProjectID, + Dataset: dprow.Dataset, + Table: dprow.TableName, + TableType: models.BigQueryType(dprow.TableType), + Created: dprow.DsrcCreated, + LastModified: dprow.DsrcLastModified, + Expires: nullTimeToPtr(dprow.DsrcExpires), + Description: dprow.DsrcDescription.String, + PiiTags: &piiTags, + MissingSince: nullTimeToPtr(dprow.DsrcMissingSince), + PseudoColumns: dprow.PseudoColumns, + }, + Schema: schema, + } + ds.Datasource = dsrc + } + + if len(dprow.Services) > 0 { + for _, service := range dprow.Services { + exist := false + for _, mapping := range ds.Mappings { + if mapping.String() == service { + exist = true + break + } + } + if !exist { + ds.Mappings = append(ds.Mappings, models.MappingService(service)) + } + } + } + + if dprow.DaID.Valid { + exist := false + for _, dsAccess := range ds.Access { + if dsAccess.ID == dprow.DaID.UUID { + exist = true + break + } + } + if !exist { + access := &models.Access{ + ID: dprow.DaID.UUID, + Subject: dprow.DaSubject.String, + Granter: dprow.DaGranter.String, + Expires: nullTimeToPtr(dprow.DaExpires), + Created: dprow.DaCreated.Time, + Revoked: nullTimeToPtr(dprow.DaRevoked), + DatasetID: dprow.DsID.UUID, + AccessRequestID: nullUUIDToUUIDPtr(dprow.AccessRequestID), + } + ds.Access = append(ds.Access, access) + } + } + + if ds.Services == nil && dprow.MmDatabaseID.Valid { + svc := &models.DatasetServices{} + base := "https://metabase.intern.dev.nav.no/browse/%v" + if os.Getenv("NAIS_CLUSTER_NAME") == "prod-gcp" { + base = "https://metabase.intern.nav.no/browse/%v" + } + url := fmt.Sprintf(base, dprow.MmDatabaseID.Int32) + svc.Metabase = &url + ds.Services = svc + } + } + keywordsMap := make(map[string]bool) + for _, ds := range datasets { + for _, k := range ds.Keywords { + keywordsMap[k] = true + } + } + keywords := []string{} + for k := range keywordsMap { + keywords = append(keywords, k) + } + + dpcomplete := &models.DataproductComplete{ + Dataproduct: dp, + Datasets: datasets, + Keywords: keywords, + } + return dpcomplete, nil +} diff --git a/pkg/database/datasets.go b/pkg/database/datasets.go index b87f663c..d2f18d9a 100644 --- a/pkg/database/datasets.go +++ b/pkg/database/datasets.go @@ -240,6 +240,7 @@ func (r *Repo) UpdateDataset(ctx context.Context, id uuid.UUID, new models.Updat } func (r *Repo) GetBigqueryDatasource(ctx context.Context, datasetID uuid.UUID, isReference bool) (models.BigQuery, error) { + fmt.Println("database getbigquerydatasource") bq, err := r.querier.GetBigqueryDatasource(ctx, gensql.GetBigqueryDatasourceParams{ DatasetID: datasetID, IsReference: isReference, @@ -296,6 +297,7 @@ func (r *Repo) UpdateBigqueryDatasourceMissing(ctx context.Context, datasetID uu } func (r *Repo) GetDatasetMetadata(ctx context.Context, id uuid.UUID) ([]*models.TableColumn, error) { + fmt.Println("database getdatasetmetadata") ds, err := r.querier.GetBigqueryDatasource(ctx, gensql.GetBigqueryDatasourceParams{ DatasetID: id, IsReference: false, @@ -315,6 +317,7 @@ func (r *Repo) GetDatasetMetadata(ctx context.Context, id uuid.UUID) ([]*models. } func (r *Repo) GetDatasetPiiTags(ctx context.Context, id uuid.UUID) (map[string]string, error) { + fmt.Println("database getdatasetpiitags") ds, err := r.querier.GetBigqueryDatasource(ctx, gensql.GetBigqueryDatasourceParams{ DatasetID: id, IsReference: false, diff --git a/pkg/database/gensql/dataproducts.sql.go b/pkg/database/gensql/dataproducts.sql.go index a2c55825..2f482a2d 100644 --- a/pkg/database/gensql/dataproducts.sql.go +++ b/pkg/database/gensql/dataproducts.sql.go @@ -8,9 +8,11 @@ package gensql import ( "context" "database/sql" + "time" "github.com/google/uuid" "github.com/lib/pq" + "github.com/sqlc-dev/pqtype" ) const createDataproduct = `-- name: CreateDataproduct :one @@ -188,6 +190,166 @@ func (q *Queries) GetDataproduct(ctx context.Context, id uuid.UUID) (Dataproduct return i, err } +const getDataproductComplete = `-- name: GetDataproductComplete :many +SELECT +dsrc.id AS dsrc_id, +dsrc.created as dsrc_created, +dsrc.last_modified as dsrc_last_modified, +dsrc.expires as dsrc_expires, +dsrc.description as dsrc_description, +dsrc.missing_since as dsrc_missing_since, +dsrc.pii_tags as pii_tags, +dsrc.project_id as project_id, +dsrc.dataset as dataset, +dsrc.table_name as table_name, +dsrc.table_type as table_type, +dsrc.pseudo_columns as pseudo_columns, +dsrc.dataset_id as dsrc_dataset_id, +dsrc.schema as dsrc_schema, +dpds.ds_id, dpds.ds_name, dpds.ds_description, dpds.ds_created, dpds.ds_last_modified, dpds.ds_slug, dpds.keywords, dpds.id, dpds.name, dpds.description, dpds."group", dpds.created, dpds.last_modified, dpds.tsv_document, dpds.slug, dpds.teamkatalogen_url, dpds.team_contact, dpds.team_id, +dm.services, +da.id as da_id, +da.subject as da_subject, +da.granter as da_granter, +da.expires as da_expires, +da.created as da_created, +da.revoked as da_revoked, +da.access_request_id as access_request_id, +mm.database_id as mm_database_id +FROM +( + SELECT + ds.id AS ds_id, + ds.name as ds_name, + ds.description as ds_description, + ds.created as ds_created, + ds.last_modified as ds_last_modified, + ds.slug as ds_slug, + ds.keywords as keywords, + rdp.id, rdp.name, rdp.description, rdp."group", rdp.created, rdp.last_modified, rdp.tsv_document, rdp.slug, rdp.teamkatalogen_url, rdp.team_contact, rdp.team_id + FROM + ( + (SELECT id, name, description, "group", created, last_modified, tsv_document, slug, teamkatalogen_url, team_contact, team_id FROM dataproducts dp WHERE dp.id= $1) rdp + LEFT JOIN datasets ds ON ds.dataproduct_id = rdp.id + ) +) dpds +LEFT JOIN + (SELECT dataset_id, project_id, dataset, table_name, schema, last_modified, created, expires, table_type, description, pii_tags, missing_since, id, is_reference, pseudo_columns, deleted FROM datasource_bigquery WHERE is_reference = false) dsrc +ON dpds.ds_id = dsrc.dataset_id +LEFT JOIN third_party_mappings dm ON dpds.ds_id = dm.dataset_id +LEFT JOIN dataset_access da ON dpds.ds_id = da.dataset_id +LEFT JOIN metabase_metadata mm ON mm.dataset_id = dpds.ds_id AND mm.deleted_at IS NULL +` + +type GetDataproductCompleteRow struct { + DsrcID uuid.UUID + DsrcCreated time.Time + DsrcLastModified time.Time + DsrcExpires sql.NullTime + DsrcDescription sql.NullString + DsrcMissingSince sql.NullTime + PiiTags pqtype.NullRawMessage + ProjectID string + Dataset string + TableName string + TableType string + PseudoColumns []string + DsrcDatasetID uuid.UUID + DsrcSchema pqtype.NullRawMessage + DsID uuid.NullUUID + DsName sql.NullString + DsDescription sql.NullString + DsCreated sql.NullTime + DsLastModified sql.NullTime + DsSlug sql.NullString + Keywords []string + ID uuid.UUID + Name string + Description sql.NullString + Group string + Created time.Time + LastModified time.Time + TsvDocument interface{} + Slug string + TeamkatalogenUrl sql.NullString + TeamContact sql.NullString + TeamID sql.NullString + Services []string + DaID uuid.NullUUID + DaSubject sql.NullString + DaGranter sql.NullString + DaExpires sql.NullTime + DaCreated sql.NullTime + DaRevoked sql.NullTime + AccessRequestID uuid.NullUUID + MmDatabaseID sql.NullInt32 +} + +func (q *Queries) GetDataproductComplete(ctx context.Context, id uuid.UUID) ([]GetDataproductCompleteRow, error) { + rows, err := q.db.QueryContext(ctx, getDataproductComplete, id) + if err != nil { + return nil, err + } + defer rows.Close() + items := []GetDataproductCompleteRow{} + for rows.Next() { + var i GetDataproductCompleteRow + if err := rows.Scan( + &i.DsrcID, + &i.DsrcCreated, + &i.DsrcLastModified, + &i.DsrcExpires, + &i.DsrcDescription, + &i.DsrcMissingSince, + &i.PiiTags, + &i.ProjectID, + &i.Dataset, + &i.TableName, + &i.TableType, + pq.Array(&i.PseudoColumns), + &i.DsrcDatasetID, + &i.DsrcSchema, + &i.DsID, + &i.DsName, + &i.DsDescription, + &i.DsCreated, + &i.DsLastModified, + &i.DsSlug, + pq.Array(&i.Keywords), + &i.ID, + &i.Name, + &i.Description, + &i.Group, + &i.Created, + &i.LastModified, + &i.TsvDocument, + &i.Slug, + &i.TeamkatalogenUrl, + &i.TeamContact, + &i.TeamID, + pq.Array(&i.Services), + &i.DaID, + &i.DaSubject, + &i.DaGranter, + &i.DaExpires, + &i.DaCreated, + &i.DaRevoked, + &i.AccessRequestID, + &i.MmDatabaseID, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + const getDataproducts = `-- name: GetDataproducts :many SELECT id, name, description, "group", created, last_modified, tsv_document, slug, teamkatalogen_url, team_contact, team_id FROM dataproducts diff --git a/pkg/database/gensql/db.go b/pkg/database/gensql/db.go index ebeacfa3..96080af1 100644 --- a/pkg/database/gensql/db.go +++ b/pkg/database/gensql/db.go @@ -24,8 +24,10 @@ type Queries struct { db DBTX } +/* func (q *Queries) WithTx(tx *sql.Tx) *Queries { return &Queries{ db: tx, } } +*/ \ No newline at end of file diff --git a/pkg/database/gensql/delegate_dbtx.go b/pkg/database/gensql/delegate_dbtx.go new file mode 100644 index 00000000..f7f608c0 --- /dev/null +++ b/pkg/database/gensql/delegate_dbtx.go @@ -0,0 +1,48 @@ +package gensql + +import ( + "context" + "database/sql" + "fmt" + "strings" +) + +// LoggingDBTX struct implementing the DBTX interface as a delegate +type LoggingDBTX struct { + db DBTX +} + +// New function modified to return a Queries object with db set to the delegate of the parameter db +func NewWithLog(db DBTX) *Queries { + return &Queries{db: &LoggingDBTX{db: db}} +} + +// WithTx function in Queries struct +func (q *Queries) WithTx(tx *sql.Tx) *Queries { + return q +} + +// Logging methods for LoggingDBTX +func (l *LoggingDBTX) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) { + queryComponents := strings.Split(query, ":") + fmt.Printf("ExecContext called with query: %s and args: %v\n", queryComponents[1], args) + return l.db.ExecContext(ctx, query, args...) +} + +func (l *LoggingDBTX) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { + queryComponents := strings.Split(query, ":") + fmt.Printf("PrepareContext called with query: %s\n", queryComponents[1]) + return l.db.PrepareContext(ctx, query) +} + +func (l *LoggingDBTX) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) { + queryComponents := strings.Split(query, ":") + fmt.Printf("QueryContext called with query: %s and args: %v\n", queryComponents[1], args) + return l.db.QueryContext(ctx, query, args...) +} + +func (l *LoggingDBTX) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row { + queryComponents := strings.Split(query, ":") + fmt.Printf("QueryRowContext called with query: %s and args: %v\n", queryComponents[1], args) + return l.db.QueryRowContext(ctx, query, args...) +} diff --git a/pkg/database/gensql/querier.go b/pkg/database/gensql/querier.go index ea367b83..b28bce8a 100644 --- a/pkg/database/gensql/querier.go +++ b/pkg/database/gensql/querier.go @@ -58,6 +58,7 @@ type Querier interface { GetBigqueryDatasources(ctx context.Context) ([]DatasourceBigquery, error) GetDashboard(ctx context.Context, id string) (Dashboard, error) GetDataproduct(ctx context.Context, id uuid.UUID) (Dataproduct, error) + GetDataproductComplete(ctx context.Context, id uuid.UUID) ([]GetDataproductCompleteRow, error) GetDataproducts(ctx context.Context, arg GetDataproductsParams) ([]Dataproduct, error) GetDataproductsByGroups(ctx context.Context, groups []string) ([]Dataproduct, error) GetDataproductsByIDs(ctx context.Context, ids []uuid.UUID) ([]Dataproduct, error) diff --git a/pkg/database/queries/dataproducts.sql b/pkg/database/queries/dataproducts.sql index cf27887e..feb14577 100644 --- a/pkg/database/queries/dataproducts.sql +++ b/pkg/database/queries/dataproducts.sql @@ -87,3 +87,53 @@ FROM "dataproducts" GROUP BY "group" ORDER BY "count" DESC LIMIT @lim OFFSET @offs; + +-- name: GetDataproductComplete :many +SELECT +dsrc.id AS dsrc_id, +dsrc.created as dsrc_created, +dsrc.last_modified as dsrc_last_modified, +dsrc.expires as dsrc_expires, +dsrc.description as dsrc_description, +dsrc.missing_since as dsrc_missing_since, +dsrc.pii_tags as pii_tags, +dsrc.project_id as project_id, +dsrc.dataset as dataset, +dsrc.table_name as table_name, +dsrc.table_type as table_type, +dsrc.pseudo_columns as pseudo_columns, +dsrc.dataset_id as dsrc_dataset_id, +dsrc.schema as dsrc_schema, +dpds.*, +dm.services, +da.id as da_id, +da.subject as da_subject, +da.granter as da_granter, +da.expires as da_expires, +da.created as da_created, +da.revoked as da_revoked, +da.access_request_id as access_request_id, +mm.database_id as mm_database_id +FROM +( + SELECT + ds.id AS ds_id, + ds.name as ds_name, + ds.description as ds_description, + ds.created as ds_created, + ds.last_modified as ds_last_modified, + ds.slug as ds_slug, + ds.keywords as keywords, + rdp.* + FROM + ( + (SELECT * FROM dataproducts dp WHERE dp.id= @id) rdp + LEFT JOIN datasets ds ON ds.dataproduct_id = rdp.id + ) +) dpds +LEFT JOIN + (SELECT * FROM datasource_bigquery WHERE is_reference = false) dsrc +ON dpds.ds_id = dsrc.dataset_id +LEFT JOIN third_party_mappings dm ON dpds.ds_id = dm.dataset_id +LEFT JOIN dataset_access da ON dpds.ds_id = da.dataset_id +LEFT JOIN metabase_metadata mm ON mm.dataset_id = dpds.ds_id AND mm.deleted_at IS NULL; diff --git a/pkg/database/repo.go b/pkg/database/repo.go index 3cc17fac..73773240 100644 --- a/pkg/database/repo.go +++ b/pkg/database/repo.go @@ -62,7 +62,7 @@ func New(dbConnDSN string, maxIdleConn, maxOpenConn int, eventMgr *event.Manager } return &Repo{ - querier: gensql.New(db), + querier: gensql.NewWithLog(db), db: db, log: log, events: eventMgr, diff --git a/pkg/graph/dataproducts.resolvers.go b/pkg/graph/dataproducts.resolvers.go index 3c482ed1..5e991e09 100644 --- a/pkg/graph/dataproducts.resolvers.go +++ b/pkg/graph/dataproducts.resolvers.go @@ -51,6 +51,19 @@ func (r *dataproductResolver) Datasets(ctx context.Context, obj *models.Dataprod return r.repo.GetDatasetsInDataproduct(ctx, obj.ID) } +// Description is the resolver for the description field. +func (r *dataproductCompleteResolver) Description(ctx context.Context, obj *models.DataproductComplete, raw *bool) (string, error) { + if obj.Description == nil { + return "", nil + } + + if raw != nil && *raw { + return html.UnescapeString(*obj.Description), nil + } + + return *obj.Description, nil +} + // CreateDataproduct is the resolver for the createDataproduct field. func (r *mutationResolver) CreateDataproduct(ctx context.Context, input models.NewDataproduct) (*models.Dataproduct, error) { user := auth.GetUser(ctx) @@ -103,6 +116,11 @@ func (r *queryResolver) Dataproduct(ctx context.Context, id uuid.UUID) (*models. return r.repo.GetDataproduct(ctx, id) } +// DataproductComplete is the resolver for the dataproductComplete field. +func (r *queryResolver) DataproductComplete(ctx context.Context, id uuid.UUID) (*models.DataproductComplete, error) { + return r.repo.GetDataproductComplete(ctx, id) +} + // Dataproducts is the resolver for the dataproducts field. func (r *queryResolver) Dataproducts(ctx context.Context, limit *int, offset *int, service *models.MappingService) ([]*models.Dataproduct, error) { l, o := pagination(limit, offset) @@ -118,4 +136,10 @@ func (r *queryResolver) GroupStats(ctx context.Context, limit *int, offset *int) // Dataproduct returns generated.DataproductResolver implementation. func (r *Resolver) Dataproduct() generated.DataproductResolver { return &dataproductResolver{r} } +// DataproductComplete returns generated.DataproductCompleteResolver implementation. +func (r *Resolver) DataproductComplete() generated.DataproductCompleteResolver { + return &dataproductCompleteResolver{r} +} + type dataproductResolver struct{ *Resolver } +type dataproductCompleteResolver struct{ *Resolver } diff --git a/pkg/graph/datasets.resolvers.go b/pkg/graph/datasets.resolvers.go index 6a13be2d..7a4a1fa7 100644 --- a/pkg/graph/datasets.resolvers.go +++ b/pkg/graph/datasets.resolvers.go @@ -53,6 +53,7 @@ func (r *datasetResolver) Owner(ctx context.Context, obj *models.Dataset) (*mode // Datasource is the resolver for the datasource field. func (r *datasetResolver) Datasource(ctx context.Context, obj *models.Dataset) (models.Datasource, error) { + fmt.Println("datasource resolver") return r.repo.GetBigqueryDatasource(ctx, obj.ID, false) } @@ -117,6 +118,19 @@ func (r *datasetResolver) Mappings(ctx context.Context, obj *models.Dataset) ([] return r.repo.GetDatasetMappings(ctx, obj.ID) } +// Description is the resolver for the description field. +func (r *datasetCompleteResolver) Description(ctx context.Context, obj *models.DatasetComplete, raw *bool) (string, error) { + if obj.Description == nil { + return "", nil + } + + if raw != nil && *raw { + return html.UnescapeString(*obj.Description), nil + } + + return *obj.Description, nil +} + // CreateDataset is the resolver for the createDataset field. func (r *mutationResolver) CreateDataset(ctx context.Context, input models.NewDataset) (*models.Dataset, error) { user := auth.GetUser(ctx) @@ -302,5 +316,11 @@ func (r *Resolver) BigQuery() generated.BigQueryResolver { return &bigQueryResol // Dataset returns generated.DatasetResolver implementation. func (r *Resolver) Dataset() generated.DatasetResolver { return &datasetResolver{r} } +// DatasetComplete returns generated.DatasetCompleteResolver implementation. +func (r *Resolver) DatasetComplete() generated.DatasetCompleteResolver { + return &datasetCompleteResolver{r} +} + type bigQueryResolver struct{ *Resolver } type datasetResolver struct{ *Resolver } +type datasetCompleteResolver struct{ *Resolver } diff --git a/pkg/graph/generated/generated.go b/pkg/graph/generated/generated.go index c5309cea..d512b0ba 100644 --- a/pkg/graph/generated/generated.go +++ b/pkg/graph/generated/generated.go @@ -44,7 +44,9 @@ type ResolverRoot interface { Access() AccessResolver BigQuery() BigQueryResolver Dataproduct() DataproductResolver + DataproductComplete() DataproductCompleteResolver Dataset() DatasetResolver + DatasetComplete() DatasetCompleteResolver InsightProduct() InsightProductResolver Mutation() MutationResolver Owner() OwnerResolver @@ -109,6 +111,22 @@ type ComplexityRoot struct { TableType func(childComplexity int) int } + BigQueryComplete struct { + Created func(childComplexity int) int + Dataset func(childComplexity int) int + Description func(childComplexity int) int + Expires func(childComplexity int) int + ID func(childComplexity int) int + LastModified func(childComplexity int) int + MissingSince func(childComplexity int) int + PiiTags func(childComplexity int) int + ProjectID func(childComplexity int) int + PseudoColumns func(childComplexity int) int + Schema func(childComplexity int) int + Table func(childComplexity int) int + TableType func(childComplexity int) int + } + BigQuerySource struct { Dataset func(childComplexity int) int Table func(childComplexity int) int @@ -133,6 +151,18 @@ type ComplexityRoot struct { Slug func(childComplexity int) int } + DataproductComplete struct { + Created func(childComplexity int) int + Datasets func(childComplexity int) int + Description func(childComplexity int, raw *bool) int + ID func(childComplexity int) int + Keywords func(childComplexity int) int + LastModified func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + Slug func(childComplexity int) int + } + Dataset struct { Access func(childComplexity int) int AnonymisationDescription func(childComplexity int) int @@ -154,6 +184,26 @@ type ComplexityRoot struct { TargetUser func(childComplexity int) int } + DatasetComplete struct { + Access func(childComplexity int) int + AnonymisationDescription func(childComplexity int) int + Created func(childComplexity int) int + DataproductID func(childComplexity int) int + Datasource func(childComplexity int) int + Description func(childComplexity int, raw *bool) int + ID func(childComplexity int) int + Keywords func(childComplexity int) int + LastModified func(childComplexity int) int + Mappings func(childComplexity int) int + Name func(childComplexity int) int + Owner func(childComplexity int) int + Pii func(childComplexity int) int + Repo func(childComplexity int) int + Services func(childComplexity int) int + Slug func(childComplexity int) int + TargetUser func(childComplexity int) int + } + DatasetServices struct { Metabase func(childComplexity int) int } @@ -302,6 +352,7 @@ type ComplexityRoot struct { AccessRequestsForDataset func(childComplexity int, datasetID uuid.UUID) int AccessiblePseudoDatasets func(childComplexity int) int Dataproduct func(childComplexity int, id uuid.UUID) int + DataproductComplete func(childComplexity int, id uuid.UUID) int Dataproducts func(childComplexity int, limit *int, offset *int, service *models.MappingService) int Dataset func(childComplexity int, id uuid.UUID) int DatasetsInDataproduct func(childComplexity int, dataproductID uuid.UUID) int @@ -436,6 +487,9 @@ type DataproductResolver interface { Keywords(ctx context.Context, obj *models.Dataproduct) ([]string, error) Datasets(ctx context.Context, obj *models.Dataproduct) ([]*models.Dataset, error) } +type DataproductCompleteResolver interface { + Description(ctx context.Context, obj *models.DataproductComplete, raw *bool) (string, error) +} type DatasetResolver interface { Dataproduct(ctx context.Context, obj *models.Dataset) (*models.Dataproduct, error) @@ -448,6 +502,9 @@ type DatasetResolver interface { Services(ctx context.Context, obj *models.Dataset) (*models.DatasetServices, error) Mappings(ctx context.Context, obj *models.Dataset) ([]models.MappingService, error) } +type DatasetCompleteResolver interface { + Description(ctx context.Context, obj *models.DatasetComplete, raw *bool) (string, error) +} type InsightProductResolver interface { ProductAreaID(ctx context.Context, obj *models.InsightProduct) (*string, error) } @@ -499,6 +556,7 @@ type QueryResolver interface { Version(ctx context.Context) (string, error) AccessRequest(ctx context.Context, id uuid.UUID) (*models.AccessRequest, error) Dataproduct(ctx context.Context, id uuid.UUID) (*models.Dataproduct, error) + DataproductComplete(ctx context.Context, id uuid.UUID) (*models.DataproductComplete, error) Dataproducts(ctx context.Context, limit *int, offset *int, service *models.MappingService) ([]*models.Dataproduct, error) GroupStats(ctx context.Context, limit *int, offset *int) ([]*models.GroupStats, error) Dataset(ctx context.Context, id uuid.UUID) (*models.Dataset, error) @@ -819,6 +877,97 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.BigQuery.TableType(childComplexity), true + case "BigQueryComplete.created": + if e.complexity.BigQueryComplete.Created == nil { + break + } + + return e.complexity.BigQueryComplete.Created(childComplexity), true + + case "BigQueryComplete.dataset": + if e.complexity.BigQueryComplete.Dataset == nil { + break + } + + return e.complexity.BigQueryComplete.Dataset(childComplexity), true + + case "BigQueryComplete.description": + if e.complexity.BigQueryComplete.Description == nil { + break + } + + return e.complexity.BigQueryComplete.Description(childComplexity), true + + case "BigQueryComplete.expires": + if e.complexity.BigQueryComplete.Expires == nil { + break + } + + return e.complexity.BigQueryComplete.Expires(childComplexity), true + + case "BigQueryComplete.id": + if e.complexity.BigQueryComplete.ID == nil { + break + } + + return e.complexity.BigQueryComplete.ID(childComplexity), true + + case "BigQueryComplete.lastModified": + if e.complexity.BigQueryComplete.LastModified == nil { + break + } + + return e.complexity.BigQueryComplete.LastModified(childComplexity), true + + case "BigQueryComplete.missingSince": + if e.complexity.BigQueryComplete.MissingSince == nil { + break + } + + return e.complexity.BigQueryComplete.MissingSince(childComplexity), true + + case "BigQueryComplete.piiTags": + if e.complexity.BigQueryComplete.PiiTags == nil { + break + } + + return e.complexity.BigQueryComplete.PiiTags(childComplexity), true + + case "BigQueryComplete.projectID": + if e.complexity.BigQueryComplete.ProjectID == nil { + break + } + + return e.complexity.BigQueryComplete.ProjectID(childComplexity), true + + case "BigQueryComplete.pseudoColumns": + if e.complexity.BigQueryComplete.PseudoColumns == nil { + break + } + + return e.complexity.BigQueryComplete.PseudoColumns(childComplexity), true + + case "BigQueryComplete.schema": + if e.complexity.BigQueryComplete.Schema == nil { + break + } + + return e.complexity.BigQueryComplete.Schema(childComplexity), true + + case "BigQueryComplete.table": + if e.complexity.BigQueryComplete.Table == nil { + break + } + + return e.complexity.BigQueryComplete.Table(childComplexity), true + + case "BigQueryComplete.tableType": + if e.complexity.BigQueryComplete.TableType == nil { + break + } + + return e.complexity.BigQueryComplete.TableType(childComplexity), true + case "BigQuerySource.dataset": if e.complexity.BigQuerySource.Dataset == nil { break @@ -929,6 +1078,74 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Dataproduct.Slug(childComplexity), true + case "DataproductComplete.created": + if e.complexity.DataproductComplete.Created == nil { + break + } + + return e.complexity.DataproductComplete.Created(childComplexity), true + + case "DataproductComplete.datasets": + if e.complexity.DataproductComplete.Datasets == nil { + break + } + + return e.complexity.DataproductComplete.Datasets(childComplexity), true + + case "DataproductComplete.description": + if e.complexity.DataproductComplete.Description == nil { + break + } + + args, err := ec.field_DataproductComplete_description_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.DataproductComplete.Description(childComplexity, args["raw"].(*bool)), true + + case "DataproductComplete.id": + if e.complexity.DataproductComplete.ID == nil { + break + } + + return e.complexity.DataproductComplete.ID(childComplexity), true + + case "DataproductComplete.keywords": + if e.complexity.DataproductComplete.Keywords == nil { + break + } + + return e.complexity.DataproductComplete.Keywords(childComplexity), true + + case "DataproductComplete.lastModified": + if e.complexity.DataproductComplete.LastModified == nil { + break + } + + return e.complexity.DataproductComplete.LastModified(childComplexity), true + + case "DataproductComplete.name": + if e.complexity.DataproductComplete.Name == nil { + break + } + + return e.complexity.DataproductComplete.Name(childComplexity), true + + case "DataproductComplete.owner": + if e.complexity.DataproductComplete.Owner == nil { + break + } + + return e.complexity.DataproductComplete.Owner(childComplexity), true + + case "DataproductComplete.slug": + if e.complexity.DataproductComplete.Slug == nil { + break + } + + return e.complexity.DataproductComplete.Slug(childComplexity), true + case "Dataset.access": if e.complexity.Dataset.Access == nil { break @@ -1060,6 +1277,130 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Dataset.TargetUser(childComplexity), true + case "DatasetComplete.access": + if e.complexity.DatasetComplete.Access == nil { + break + } + + return e.complexity.DatasetComplete.Access(childComplexity), true + + case "DatasetComplete.anonymisation_description": + if e.complexity.DatasetComplete.AnonymisationDescription == nil { + break + } + + return e.complexity.DatasetComplete.AnonymisationDescription(childComplexity), true + + case "DatasetComplete.created": + if e.complexity.DatasetComplete.Created == nil { + break + } + + return e.complexity.DatasetComplete.Created(childComplexity), true + + case "DatasetComplete.dataproductID": + if e.complexity.DatasetComplete.DataproductID == nil { + break + } + + return e.complexity.DatasetComplete.DataproductID(childComplexity), true + + case "DatasetComplete.datasource": + if e.complexity.DatasetComplete.Datasource == nil { + break + } + + return e.complexity.DatasetComplete.Datasource(childComplexity), true + + case "DatasetComplete.description": + if e.complexity.DatasetComplete.Description == nil { + break + } + + args, err := ec.field_DatasetComplete_description_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.DatasetComplete.Description(childComplexity, args["raw"].(*bool)), true + + case "DatasetComplete.id": + if e.complexity.DatasetComplete.ID == nil { + break + } + + return e.complexity.DatasetComplete.ID(childComplexity), true + + case "DatasetComplete.keywords": + if e.complexity.DatasetComplete.Keywords == nil { + break + } + + return e.complexity.DatasetComplete.Keywords(childComplexity), true + + case "DatasetComplete.lastModified": + if e.complexity.DatasetComplete.LastModified == nil { + break + } + + return e.complexity.DatasetComplete.LastModified(childComplexity), true + + case "DatasetComplete.mappings": + if e.complexity.DatasetComplete.Mappings == nil { + break + } + + return e.complexity.DatasetComplete.Mappings(childComplexity), true + + case "DatasetComplete.name": + if e.complexity.DatasetComplete.Name == nil { + break + } + + return e.complexity.DatasetComplete.Name(childComplexity), true + + case "DatasetComplete.owner": + if e.complexity.DatasetComplete.Owner == nil { + break + } + + return e.complexity.DatasetComplete.Owner(childComplexity), true + + case "DatasetComplete.pii": + if e.complexity.DatasetComplete.Pii == nil { + break + } + + return e.complexity.DatasetComplete.Pii(childComplexity), true + + case "DatasetComplete.repo": + if e.complexity.DatasetComplete.Repo == nil { + break + } + + return e.complexity.DatasetComplete.Repo(childComplexity), true + + case "DatasetComplete.services": + if e.complexity.DatasetComplete.Services == nil { + break + } + + return e.complexity.DatasetComplete.Services(childComplexity), true + + case "DatasetComplete.slug": + if e.complexity.DatasetComplete.Slug == nil { + break + } + + return e.complexity.DatasetComplete.Slug(childComplexity), true + + case "DatasetComplete.targetUser": + if e.complexity.DatasetComplete.TargetUser == nil { + break + } + + return e.complexity.DatasetComplete.TargetUser(childComplexity), true + case "DatasetServices.metabase": if e.complexity.DatasetServices.Metabase == nil { break @@ -1898,6 +2239,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.Dataproduct(childComplexity, args["id"].(uuid.UUID)), true + case "Query.dataproductComplete": + if e.complexity.Query.DataproductComplete == nil { + break + } + + args, err := ec.field_Query_dataproductComplete_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.DataproductComplete(childComplexity, args["id"].(uuid.UUID)), true + case "Query.dataproducts": if e.complexity.Query.Dataproducts == nil { break @@ -2921,6 +3274,30 @@ type Dataproduct @goModel(model: "github.com/navikt/nada-backend/pkg/graph/model datasets: [Dataset!]! } +""" +DataproductComplete contains metadata on a datasource. +""" +type DataproductComplete @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DataproductComplete"){ + "id is the identifier for the dataproduct" + id: ID! + "name of the dataproduct" + name: String! + "description of the dataproduct" + description(raw: Boolean): String! @goField(forceResolver: true) + "created is the timestamp for when the dataproduct was created" + created: Time! + "lastModified is the timestamp for when the dataproduct was last modified" + lastModified: Time! + "slug is the dataproduct slug" + slug: String! + "owner of the dataproduct. Changes to the dataproduct can only be done by a member of the owner." + owner: Owner! + "keywords is the keyword tags for the datasets in the dataproduct." + keywords: [String!]! + "datasets is the list of associated datasets." + datasets: [DatasetComplete!]! +} + """ GroupStats contains statistics on a group. """ @@ -2940,6 +3317,14 @@ extend type Query { id: ID! ): Dataproduct! + """ + dataproductComplete returns the given dataproduct with complete information. + """ + dataproductComplete( + "id of the requested dataproduct." + id: ID! + ): DataproductComplete! + """ dataproducts returns a list of dataproducts. Pagination done using the arguments. """ @@ -3078,19 +3463,59 @@ type Dataset @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.Da targetUser: String } -type DatasetServices @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DatasetServices") { - "URL to the dataset in metabase" - metabase: String -} - """ -TableColumn contains metadata on a BigQuery table column. +DatasetComplete contains metadata on a dataset. """ -type TableColumn @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.TableColumn") { - "name of column." - name: String! - "description of column." - description: String! +type DatasetComplete @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DatasetComplete"){ + "id is the identifier for the dataset" + id: ID! + "dataproductID is the id of the dataproduct containing the dataset" + dataproductID: ID! + "name of the dataset" + name: String! + "description of the dataset" + description(raw: Boolean): String! @goField(forceResolver: true) + "created is the timestamp for when the dataset was created" + created: Time! + "lastModified is the timestamp for when the dataset was last modified" + lastModified: Time! + "repo is the url of the repository containing the code to create the dataset" + repo: String + "pii indicates whether it is personal identifiable information in the dataset" + pii: PiiLevel! + "keywords for the dataset used as tags." + keywords: [String!]! + "owner is the owner of the dataproduct containing this dataset" + owner: Owner! + "slug is the dataset slug" + slug: String! + "datasource contains metadata on the datasource" + datasource: Datasource! + "access contains list of users, groups and service accounts which have access to the dataset" + access: [Access!]! + "services contains links to this dataset in other services" + services: DatasetServices! + "mappings services a dataset is exposed to" + mappings: [MappingService!]! + "anonymisation_description explains how the dataset was anonymised, should be null if ` + "`" + `pii` + "`" + ` isn't anonymised" + anonymisation_description: String + "targetUser is the type of user that the dataset is meant to be used by" + targetUser: String +} + +type DatasetServices @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DatasetServices") { + "URL to the dataset in metabase" + metabase: String +} + +""" +TableColumn contains metadata on a BigQuery table column. +""" +type TableColumn @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.TableColumn") { + "name of column." + name: String! + "description of column." + description: String! "mode of column (NULLABLE, REQUIRED or REPEATED)." mode: String! "type is the datatype of the column." @@ -3131,6 +3556,39 @@ type BigQuery @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.B } +""" +BigQueryComplete contains metadata on a BigQuery table. +""" +type BigQueryComplete @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.BigQueryComplete") { + "id is the identifier for the datasource" + id: ID! + "projectID is the GCP project ID that contains the BigQuery table" + projectID: String! + "dataset is the dataset that contains the BigQuery table" + dataset: String! + "table name for BigQuery table" + table: String! + "schema for the BigQuery table" + schema: [TableColumn!]! + "lastModified is the time when the table was last modified" + lastModified: Time! + "created is when the table was created" + created: Time! + "expires, if set, is when the table expires" + expires: Time + "tableType is what type the table is" + tableType: BigQueryType! + "description is the description of the BigQuery table" + description: String! + "piiTags is json string from the pii tags map" + piiTags: String + "missingSince, if set, is the time when the table got deleted from BigQuery" + missingSince: Time + "pseudoColumns, if set, the columns are pseudonymised" + pseudoColumns: [String!] + +} + """ PseudoDataset contains information about a pseudo dataset """ @@ -3146,7 +3604,7 @@ type PseudoDataset @goModel(model: "github.com/navikt/nada-backend/pkg/graph/mod """ Datasource defines types that can be returned as a dataset datasource. """ -union Datasource @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.Datasource") = BigQuery +union Datasource @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.Datasource") = BigQuery | BigQueryComplete extend type Query { """ @@ -4305,6 +4763,21 @@ func (ec *executionContext) dir_authenticated_args(ctx context.Context, rawArgs return args, nil } +func (ec *executionContext) field_DataproductComplete_description_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["raw"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("raw")) + arg0, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["raw"] = arg0 + return args, nil +} + func (ec *executionContext) field_Dataproduct_description_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -4320,6 +4793,21 @@ func (ec *executionContext) field_Dataproduct_description_args(ctx context.Conte return args, nil } +func (ec *executionContext) field_DatasetComplete_description_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["raw"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("raw")) + arg0, err = ec.unmarshalOBoolean2ᚖbool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["raw"] = arg0 + return args, nil +} + func (ec *executionContext) field_Dataset_description_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -5019,6 +5507,21 @@ func (ec *executionContext) field_Query_accessRequestsForDataset_args(ctx contex return args, nil } +func (ec *executionContext) field_Query_dataproductComplete_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 uuid.UUID + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_dataproduct_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} @@ -7058,8 +7561,8 @@ func (ec *executionContext) fieldContext_BigQuery_pseudoColumns(ctx context.Cont return fc, nil } -func (ec *executionContext) _BigQuerySource_table(ctx context.Context, field graphql.CollectedField, obj *models.BigQuerySource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BigQuerySource_table(ctx, field) +func (ec *executionContext) _BigQueryComplete_id(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_id(ctx, field) if err != nil { return graphql.Null } @@ -7072,7 +7575,7 @@ func (ec *executionContext) _BigQuerySource_table(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Table, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7084,26 +7587,26 @@ func (ec *executionContext) _BigQuerySource_table(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BigQuerySource_table(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BigQuerySource", + Object: "BigQueryComplete", 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 nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _BigQuerySource_dataset(ctx context.Context, field graphql.CollectedField, obj *models.BigQuerySource) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BigQuerySource_dataset(ctx, field) +func (ec *executionContext) _BigQueryComplete_projectID(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_projectID(ctx, field) if err != nil { return graphql.Null } @@ -7116,7 +7619,7 @@ func (ec *executionContext) _BigQuerySource_dataset(ctx context.Context, field g }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Dataset, nil + return obj.ProjectID, nil }) if err != nil { ec.Error(ctx, err) @@ -7133,9 +7636,9 @@ func (ec *executionContext) _BigQuerySource_dataset(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BigQuerySource_dataset(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_projectID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BigQuerySource", + Object: "BigQueryComplete", Field: field, IsMethod: false, IsResolver: false, @@ -7146,8 +7649,8 @@ func (ec *executionContext) fieldContext_BigQuerySource_dataset(ctx context.Cont return fc, nil } -func (ec *executionContext) _BigQueryTable_name(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BigQueryTable_name(ctx, field) +func (ec *executionContext) _BigQueryComplete_dataset(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_dataset(ctx, field) if err != nil { return graphql.Null } @@ -7160,7 +7663,7 @@ func (ec *executionContext) _BigQueryTable_name(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Dataset, nil }) if err != nil { ec.Error(ctx, err) @@ -7177,9 +7680,9 @@ func (ec *executionContext) _BigQueryTable_name(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BigQueryTable_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_dataset(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BigQueryTable", + Object: "BigQueryComplete", Field: field, IsMethod: false, IsResolver: false, @@ -7190,8 +7693,8 @@ func (ec *executionContext) fieldContext_BigQueryTable_name(ctx context.Context, return fc, nil } -func (ec *executionContext) _BigQueryTable_description(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BigQueryTable_description(ctx, field) +func (ec *executionContext) _BigQueryComplete_table(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_table(ctx, field) if err != nil { return graphql.Null } @@ -7204,7 +7707,7 @@ func (ec *executionContext) _BigQueryTable_description(ctx context.Context, fiel }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.Table, nil }) if err != nil { ec.Error(ctx, err) @@ -7221,9 +7724,9 @@ func (ec *executionContext) _BigQueryTable_description(ctx context.Context, fiel return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BigQueryTable_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_table(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BigQueryTable", + Object: "BigQueryComplete", Field: field, IsMethod: false, IsResolver: false, @@ -7234,8 +7737,8 @@ func (ec *executionContext) fieldContext_BigQueryTable_description(ctx context.C return fc, nil } -func (ec *executionContext) _BigQueryTable_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BigQueryTable_lastModified(ctx, field) +func (ec *executionContext) _BigQueryComplete_schema(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_schema(ctx, field) if err != nil { return graphql.Null } @@ -7248,7 +7751,7 @@ func (ec *executionContext) _BigQueryTable_lastModified(ctx context.Context, fie }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LastModified, nil + return obj.Schema, nil }) if err != nil { ec.Error(ctx, err) @@ -7260,26 +7763,36 @@ func (ec *executionContext) _BigQueryTable_lastModified(ctx context.Context, fie } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.([]*models.TableColumn) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNTableColumn2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐTableColumnᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BigQueryTable_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_schema(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BigQueryTable", + Object: "BigQueryComplete", 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") + switch field.Name { + case "name": + return ec.fieldContext_TableColumn_name(ctx, field) + case "description": + return ec.fieldContext_TableColumn_description(ctx, field) + case "mode": + return ec.fieldContext_TableColumn_mode(ctx, field) + case "type": + return ec.fieldContext_TableColumn_type(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type TableColumn", field.Name) }, } return fc, nil } -func (ec *executionContext) _BigQueryTable_type(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_BigQueryTable_type(ctx, field) +func (ec *executionContext) _BigQueryComplete_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_lastModified(ctx, field) if err != nil { return graphql.Null } @@ -7292,7 +7805,7 @@ func (ec *executionContext) _BigQueryTable_type(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.LastModified, nil }) if err != nil { ec.Error(ctx, err) @@ -7304,26 +7817,26 @@ func (ec *executionContext) _BigQueryTable_type(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(models.BigQueryType) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNBigQueryType2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐBigQueryType(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_BigQueryTable_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "BigQueryTable", + Object: "BigQueryComplete", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - return nil, errors.New("field of type BigQueryType does not have child fields") + return nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataproduct_id(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_id(ctx, field) +func (ec *executionContext) _BigQueryComplete_created(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_created(ctx, field) if err != nil { return graphql.Null } @@ -7336,7 +7849,7 @@ func (ec *executionContext) _Dataproduct_id(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.Created, nil }) if err != nil { ec.Error(ctx, err) @@ -7348,26 +7861,26 @@ func (ec *executionContext) _Dataproduct_id(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(uuid.UUID) + res := resTmp.(time.Time) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "BigQueryComplete", 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 nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataproduct_name(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_name(ctx, field) +func (ec *executionContext) _BigQueryComplete_expires(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_expires(ctx, field) if err != nil { return graphql.Null } @@ -7380,38 +7893,35 @@ func (ec *executionContext) _Dataproduct_name(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.Expires, 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) + res := resTmp.(*time.Time) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_expires(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "BigQueryComplete", 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 nil, errors.New("field of type Time does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataproduct_description(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_description(ctx, field) +func (ec *executionContext) _BigQueryComplete_tableType(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_tableType(ctx, field) if err != nil { return graphql.Null } @@ -7424,7 +7934,7 @@ func (ec *executionContext) _Dataproduct_description(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataproduct().Description(rctx, obj, fc.Args["raw"].(*bool)) + return obj.TableType, nil }) if err != nil { ec.Error(ctx, err) @@ -7436,37 +7946,26 @@ func (ec *executionContext) _Dataproduct_description(ctx context.Context, field } return graphql.Null } - res := resTmp.(string) + res := resTmp.(models.BigQueryType) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNBigQueryType2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐBigQueryType(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_tableType(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "BigQueryComplete", Field: field, - IsMethod: true, - IsResolver: true, + 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 nil, errors.New("field of type BigQueryType does not have child fields") }, } - 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_Dataproduct_description_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { - ec.Error(ctx, err) - return fc, err - } return fc, nil } -func (ec *executionContext) _Dataproduct_created(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_created(ctx, field) +func (ec *executionContext) _BigQueryComplete_description(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_description(ctx, field) if err != nil { return graphql.Null } @@ -7479,7 +7978,7 @@ func (ec *executionContext) _Dataproduct_created(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Created, nil + return obj.Description, nil }) if err != nil { ec.Error(ctx, err) @@ -7491,26 +7990,26 @@ func (ec *executionContext) _Dataproduct_created(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(time.Time) + res := resTmp.(string) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_BigQueryComplete_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "BigQueryComplete", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataproduct_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_lastModified(ctx, field) +func (ec *executionContext) _BigQueryComplete_piiTags(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_piiTags(ctx, field) if err != nil { return graphql.Null } @@ -7523,38 +8022,1905 @@ func (ec *executionContext) _Dataproduct_lastModified(ctx context.Context, field }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LastModified, nil + return obj.PiiTags, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BigQueryComplete_piiTags(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryComplete", + 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) _BigQueryComplete_missingSince(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_missingSince(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MissingSince, 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.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BigQueryComplete_missingSince(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryComplete", + 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) _BigQueryComplete_pseudoColumns(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryComplete_pseudoColumns(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PseudoColumns, 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_BigQueryComplete_pseudoColumns(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryComplete", + 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) _BigQuerySource_table(ctx context.Context, field graphql.CollectedField, obj *models.BigQuerySource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQuerySource_table(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Table, 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_BigQuerySource_table(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQuerySource", + 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) _BigQuerySource_dataset(ctx context.Context, field graphql.CollectedField, obj *models.BigQuerySource) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQuerySource_dataset(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Dataset, 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_BigQuerySource_dataset(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQuerySource", + 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) _BigQueryTable_name(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryTable_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_BigQueryTable_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryTable", + 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) _BigQueryTable_description(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryTable_description(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BigQueryTable_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryTable", + 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) _BigQueryTable_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryTable_lastModified(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastModified, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BigQueryTable_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryTable", + 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) _BigQueryTable_type(ctx context.Context, field graphql.CollectedField, obj *models.BigQueryTable) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_BigQueryTable_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.(models.BigQueryType) + fc.Result = res + return ec.marshalNBigQueryType2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐBigQueryType(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_BigQueryTable_type(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "BigQueryTable", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type BigQueryType does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Dataproduct_id(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_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.(uuid.UUID) + fc.Result = res + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataproduct_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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) _Dataproduct_name(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_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_Dataproduct_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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) _Dataproduct_description(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_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 ec.resolvers.Dataproduct().Description(rctx, obj, fc.Args["raw"].(*bool)) + }) + 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_Dataproduct_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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") + }, + } + 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_Dataproduct_description_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Dataproduct_created(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_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.Created, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataproduct_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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) _Dataproduct_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_lastModified(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastModified, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataproduct_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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) _Dataproduct_slug(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_slug(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Slug, 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_Dataproduct_slug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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) _Dataproduct_owner(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_owner(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Owner, 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.(*models.Owner) + fc.Result = res + return ec.marshalNOwner2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐOwner(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataproduct_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "group": + return ec.fieldContext_Owner_group(ctx, field) + case "teamkatalogenURL": + return ec.fieldContext_Owner_teamkatalogenURL(ctx, field) + case "teamContact": + return ec.fieldContext_Owner_teamContact(ctx, field) + case "productAreaID": + return ec.fieldContext_Owner_productAreaID(ctx, field) + case "teamID": + return ec.fieldContext_Owner_teamID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Dataproduct_keywords(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_keywords(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.Dataproduct().Keywords(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.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataproduct_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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) _Dataproduct_datasets(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataproduct_datasets(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.Dataproduct().Datasets(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.([]*models.Dataset) + fc.Result = res + return ec.marshalNDataset2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataproduct_datasets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataproduct", + 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_Dataset_id(ctx, field) + case "dataproductID": + return ec.fieldContext_Dataset_dataproductID(ctx, field) + case "dataproduct": + return ec.fieldContext_Dataset_dataproduct(ctx, field) + case "name": + return ec.fieldContext_Dataset_name(ctx, field) + case "description": + return ec.fieldContext_Dataset_description(ctx, field) + case "created": + return ec.fieldContext_Dataset_created(ctx, field) + case "lastModified": + return ec.fieldContext_Dataset_lastModified(ctx, field) + case "repo": + return ec.fieldContext_Dataset_repo(ctx, field) + case "pii": + return ec.fieldContext_Dataset_pii(ctx, field) + case "keywords": + return ec.fieldContext_Dataset_keywords(ctx, field) + case "owner": + return ec.fieldContext_Dataset_owner(ctx, field) + case "slug": + return ec.fieldContext_Dataset_slug(ctx, field) + case "datasource": + return ec.fieldContext_Dataset_datasource(ctx, field) + case "access": + return ec.fieldContext_Dataset_access(ctx, field) + case "services": + return ec.fieldContext_Dataset_services(ctx, field) + case "mappings": + return ec.fieldContext_Dataset_mappings(ctx, field) + case "anonymisation_description": + return ec.fieldContext_Dataset_anonymisation_description(ctx, field) + case "targetUser": + return ec.fieldContext_Dataset_targetUser(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Dataset", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DataproductComplete_id(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_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.(uuid.UUID) + fc.Result = res + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataproductComplete_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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) _DataproductComplete_name(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_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_DataproductComplete_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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) _DataproductComplete_description(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_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 ec.resolvers.DataproductComplete().Description(rctx, obj, fc.Args["raw"].(*bool)) + }) + 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_DataproductComplete_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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") + }, + } + 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_DataproductComplete_description_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _DataproductComplete_created(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_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.Created, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataproductComplete_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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) _DataproductComplete_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_lastModified(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastModified, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataproductComplete_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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) _DataproductComplete_slug(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_slug(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Slug, 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_DataproductComplete_slug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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) _DataproductComplete_owner(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_owner(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Owner, 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.(*models.Owner) + fc.Result = res + return ec.marshalNOwner2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐOwner(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataproductComplete_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "group": + return ec.fieldContext_Owner_group(ctx, field) + case "teamkatalogenURL": + return ec.fieldContext_Owner_teamkatalogenURL(ctx, field) + case "teamContact": + return ec.fieldContext_Owner_teamContact(ctx, field) + case "productAreaID": + return ec.fieldContext_Owner_productAreaID(ctx, field) + case "teamID": + return ec.fieldContext_Owner_teamID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _DataproductComplete_keywords(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_keywords(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Keywords, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataproductComplete_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + 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) _DataproductComplete_datasets(ctx context.Context, field graphql.CollectedField, obj *models.DataproductComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DataproductComplete_datasets(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Datasets, 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.([]*models.DatasetComplete) + fc.Result = res + return ec.marshalNDatasetComplete2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetCompleteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_DataproductComplete_datasets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "DataproductComplete", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "id": + return ec.fieldContext_DatasetComplete_id(ctx, field) + case "dataproductID": + return ec.fieldContext_DatasetComplete_dataproductID(ctx, field) + case "name": + return ec.fieldContext_DatasetComplete_name(ctx, field) + case "description": + return ec.fieldContext_DatasetComplete_description(ctx, field) + case "created": + return ec.fieldContext_DatasetComplete_created(ctx, field) + case "lastModified": + return ec.fieldContext_DatasetComplete_lastModified(ctx, field) + case "repo": + return ec.fieldContext_DatasetComplete_repo(ctx, field) + case "pii": + return ec.fieldContext_DatasetComplete_pii(ctx, field) + case "keywords": + return ec.fieldContext_DatasetComplete_keywords(ctx, field) + case "owner": + return ec.fieldContext_DatasetComplete_owner(ctx, field) + case "slug": + return ec.fieldContext_DatasetComplete_slug(ctx, field) + case "datasource": + return ec.fieldContext_DatasetComplete_datasource(ctx, field) + case "access": + return ec.fieldContext_DatasetComplete_access(ctx, field) + case "services": + return ec.fieldContext_DatasetComplete_services(ctx, field) + case "mappings": + return ec.fieldContext_DatasetComplete_mappings(ctx, field) + case "anonymisation_description": + return ec.fieldContext_DatasetComplete_anonymisation_description(ctx, field) + case "targetUser": + return ec.fieldContext_DatasetComplete_targetUser(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DatasetComplete", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Dataset_id(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_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.(uuid.UUID) + fc.Result = res + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_dataproductID(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_dataproductID(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DataproductID, 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.(uuid.UUID) + fc.Result = res + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_dataproductID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_dataproduct(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_dataproduct(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.Dataset().Dataproduct(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.(*models.Dataproduct) + fc.Result = res + return ec.marshalNDataproduct2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDataproduct(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_dataproduct(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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_Dataproduct_id(ctx, field) + case "name": + return ec.fieldContext_Dataproduct_name(ctx, field) + case "description": + return ec.fieldContext_Dataproduct_description(ctx, field) + case "created": + return ec.fieldContext_Dataproduct_created(ctx, field) + case "lastModified": + return ec.fieldContext_Dataproduct_lastModified(ctx, field) + case "slug": + return ec.fieldContext_Dataproduct_slug(ctx, field) + case "owner": + return ec.fieldContext_Dataproduct_owner(ctx, field) + case "keywords": + return ec.fieldContext_Dataproduct_keywords(ctx, field) + case "datasets": + return ec.fieldContext_Dataproduct_datasets(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Dataproduct", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Dataset_name(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_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_Dataset_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_description(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_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 ec.resolvers.Dataset().Description(rctx, obj, fc.Args["raw"].(*bool)) + }) + 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_Dataset_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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") + }, + } + 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_Dataset_description_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + +func (ec *executionContext) _Dataset_created(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_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.Created, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_lastModified(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LastModified, 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.(time.Time) + fc.Result = res + return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_repo(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_repo(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Repo, 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_Dataset_repo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_pii(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_pii(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Pii, 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.(models.PiiLevel) + fc.Result = res + return ec.marshalNPiiLevel2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐPiiLevel(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_pii(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type PiiLevel does not have child fields") + }, + } + return fc, nil +} + +func (ec *executionContext) _Dataset_keywords(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_keywords(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Keywords, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_owner(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_owner(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.Dataset().Owner(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.(*models.Owner) + fc.Result = res + return ec.marshalNOwner2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐOwner(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Dataset_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + Field: field, + IsMethod: true, + IsResolver: true, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + switch field.Name { + case "group": + return ec.fieldContext_Owner_group(ctx, field) + case "teamkatalogenURL": + return ec.fieldContext_Owner_teamkatalogenURL(ctx, field) + case "teamContact": + return ec.fieldContext_Owner_teamContact(ctx, field) + case "productAreaID": + return ec.fieldContext_Owner_productAreaID(ctx, field) + case "teamID": + return ec.fieldContext_Owner_teamID(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + }, + } + return fc, nil +} + +func (ec *executionContext) _Dataset_slug(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_slug(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Slug, 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_Dataset_slug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "Dataset", + 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) _Dataset_datasource(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_datasource(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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.Dataset().Datasource(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.(time.Time) + res := resTmp.(models.Datasource) fc.Result = res - return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) + return ec.marshalNDatasource2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Dataset_datasource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "Dataset", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, 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 nil, errors.New("field of type Datasource does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataproduct_slug(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_slug(ctx, field) +func (ec *executionContext) _Dataset_access(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_access(ctx, field) if err != nil { return graphql.Null } @@ -7567,7 +9933,7 @@ func (ec *executionContext) _Dataproduct_slug(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Slug, nil + return ec.resolvers.Dataset().Access(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -7579,26 +9945,44 @@ func (ec *executionContext) _Dataproduct_slug(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]*models.Access) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNAccess2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐAccessᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_slug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Dataset_access(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "Dataset", Field: field, - IsMethod: false, - IsResolver: false, + 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") + switch field.Name { + case "id": + return ec.fieldContext_Access_id(ctx, field) + case "subject": + return ec.fieldContext_Access_subject(ctx, field) + case "granter": + return ec.fieldContext_Access_granter(ctx, field) + case "expires": + return ec.fieldContext_Access_expires(ctx, field) + case "created": + return ec.fieldContext_Access_created(ctx, field) + case "revoked": + return ec.fieldContext_Access_revoked(ctx, field) + case "accessRequestID": + return ec.fieldContext_Access_accessRequestID(ctx, field) + case "accessRequest": + return ec.fieldContext_Access_accessRequest(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type Access", field.Name) }, } return fc, nil } -func (ec *executionContext) _Dataproduct_owner(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_owner(ctx, field) +func (ec *executionContext) _Dataset_services(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_services(ctx, field) if err != nil { return graphql.Null } @@ -7611,7 +9995,7 @@ func (ec *executionContext) _Dataproduct_owner(ctx context.Context, field graphq }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Owner, nil + return ec.resolvers.Dataset().Services(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -7623,38 +10007,30 @@ func (ec *executionContext) _Dataproduct_owner(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*models.Owner) + res := resTmp.(*models.DatasetServices) fc.Result = res - return ec.marshalNOwner2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐOwner(ctx, field.Selections, res) + return ec.marshalNDatasetServices2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetServices(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Dataset_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "Dataset", Field: field, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "group": - return ec.fieldContext_Owner_group(ctx, field) - case "teamkatalogenURL": - return ec.fieldContext_Owner_teamkatalogenURL(ctx, field) - case "teamContact": - return ec.fieldContext_Owner_teamContact(ctx, field) - case "productAreaID": - return ec.fieldContext_Owner_productAreaID(ctx, field) - case "teamID": - return ec.fieldContext_Owner_teamID(ctx, field) + case "metabase": + return ec.fieldContext_DatasetServices_metabase(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type Owner", field.Name) + return nil, fmt.Errorf("no field named %q was found under type DatasetServices", field.Name) }, } return fc, nil } -func (ec *executionContext) _Dataproduct_keywords(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_keywords(ctx, field) +func (ec *executionContext) _Dataset_mappings(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_mappings(ctx, field) if err != nil { return graphql.Null } @@ -7667,7 +10043,7 @@ func (ec *executionContext) _Dataproduct_keywords(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataproduct().Keywords(rctx, obj) + return ec.resolvers.Dataset().Mappings(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -7679,26 +10055,26 @@ func (ec *executionContext) _Dataproduct_keywords(ctx context.Context, field gra } return graphql.Null } - res := resTmp.([]string) + res := resTmp.([]models.MappingService) fc.Result = res - return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNMappingService2ᚕgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐMappingServiceᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Dataset_mappings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "Dataset", 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 nil, errors.New("field of type MappingService does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataproduct_datasets(ctx context.Context, field graphql.CollectedField, obj *models.Dataproduct) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataproduct_datasets(ctx, field) +func (ec *executionContext) _Dataset_anonymisation_description(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_anonymisation_description(ctx, field) if err != nil { return graphql.Null } @@ -7711,76 +10087,35 @@ func (ec *executionContext) _Dataproduct_datasets(ctx context.Context, field gra }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataproduct().Datasets(rctx, obj) + return obj.AnonymisationDescription, 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.([]*models.Dataset) + res := resTmp.(*string) fc.Result = res - return ec.marshalNDataset2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataproduct_datasets(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Dataset_anonymisation_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataproduct", + Object: "Dataset", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Dataset_id(ctx, field) - case "dataproductID": - return ec.fieldContext_Dataset_dataproductID(ctx, field) - case "dataproduct": - return ec.fieldContext_Dataset_dataproduct(ctx, field) - case "name": - return ec.fieldContext_Dataset_name(ctx, field) - case "description": - return ec.fieldContext_Dataset_description(ctx, field) - case "created": - return ec.fieldContext_Dataset_created(ctx, field) - case "lastModified": - return ec.fieldContext_Dataset_lastModified(ctx, field) - case "repo": - return ec.fieldContext_Dataset_repo(ctx, field) - case "pii": - return ec.fieldContext_Dataset_pii(ctx, field) - case "keywords": - return ec.fieldContext_Dataset_keywords(ctx, field) - case "owner": - return ec.fieldContext_Dataset_owner(ctx, field) - case "slug": - return ec.fieldContext_Dataset_slug(ctx, field) - case "datasource": - return ec.fieldContext_Dataset_datasource(ctx, field) - case "access": - return ec.fieldContext_Dataset_access(ctx, field) - case "services": - return ec.fieldContext_Dataset_services(ctx, field) - case "mappings": - return ec.fieldContext_Dataset_mappings(ctx, field) - case "anonymisation_description": - return ec.fieldContext_Dataset_anonymisation_description(ctx, field) - case "targetUser": - return ec.fieldContext_Dataset_targetUser(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Dataset", field.Name) + return nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataset_id(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_id(ctx, field) +func (ec *executionContext) _Dataset_targetUser(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Dataset_targetUser(ctx, field) if err != nil { return graphql.Null } @@ -7793,38 +10128,35 @@ func (ec *executionContext) _Dataset_id(ctx context.Context, field graphql.Colle }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.TargetUser, 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.(uuid.UUID) + res := resTmp.(*string) fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Dataset_targetUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Dataset", 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 nil, errors.New("field of type String does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataset_dataproductID(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_dataproductID(ctx, field) +func (ec *executionContext) _DatasetComplete_id(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_id(ctx, field) if err != nil { return graphql.Null } @@ -7837,7 +10169,7 @@ func (ec *executionContext) _Dataset_dataproductID(ctx context.Context, field gr }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DataproductID, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -7854,9 +10186,9 @@ func (ec *executionContext) _Dataset_dataproductID(ctx context.Context, field gr return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_dataproductID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_id(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -7867,8 +10199,8 @@ func (ec *executionContext) fieldContext_Dataset_dataproductID(ctx context.Conte return fc, nil } -func (ec *executionContext) _Dataset_dataproduct(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_dataproduct(ctx, field) +func (ec *executionContext) _DatasetComplete_dataproductID(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_dataproductID(ctx, field) if err != nil { return graphql.Null } @@ -7881,7 +10213,7 @@ func (ec *executionContext) _Dataset_dataproduct(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Dataproduct(rctx, obj) + return obj.DataproductID, nil }) if err != nil { ec.Error(ctx, err) @@ -7893,46 +10225,26 @@ func (ec *executionContext) _Dataset_dataproduct(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*models.Dataproduct) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNDataproduct2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDataproduct(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_dataproduct(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_dataproductID(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { - switch field.Name { - case "id": - return ec.fieldContext_Dataproduct_id(ctx, field) - case "name": - return ec.fieldContext_Dataproduct_name(ctx, field) - case "description": - return ec.fieldContext_Dataproduct_description(ctx, field) - case "created": - return ec.fieldContext_Dataproduct_created(ctx, field) - case "lastModified": - return ec.fieldContext_Dataproduct_lastModified(ctx, field) - case "slug": - return ec.fieldContext_Dataproduct_slug(ctx, field) - case "owner": - return ec.fieldContext_Dataproduct_owner(ctx, field) - case "keywords": - return ec.fieldContext_Dataproduct_keywords(ctx, field) - case "datasets": - return ec.fieldContext_Dataproduct_datasets(ctx, field) - } - return nil, fmt.Errorf("no field named %q was found under type Dataproduct", field.Name) + return nil, errors.New("field of type ID does not have child fields") }, } return fc, nil } -func (ec *executionContext) _Dataset_name(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_name(ctx, field) +func (ec *executionContext) _DatasetComplete_name(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_name(ctx, field) if err != nil { return graphql.Null } @@ -7962,9 +10274,9 @@ func (ec *executionContext) _Dataset_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_name(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -7975,8 +10287,8 @@ func (ec *executionContext) fieldContext_Dataset_name(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Dataset_description(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_description(ctx, field) +func (ec *executionContext) _DatasetComplete_description(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_description(ctx, field) if err != nil { return graphql.Null } @@ -7989,7 +10301,7 @@ func (ec *executionContext) _Dataset_description(ctx context.Context, field grap }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Description(rctx, obj, fc.Args["raw"].(*bool)) + return ec.resolvers.DatasetComplete().Description(rctx, obj, fc.Args["raw"].(*bool)) }) if err != nil { ec.Error(ctx, err) @@ -8006,9 +10318,9 @@ func (ec *executionContext) _Dataset_description(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: true, IsResolver: true, @@ -8023,15 +10335,15 @@ func (ec *executionContext) fieldContext_Dataset_description(ctx context.Context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Dataset_description_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_DatasetComplete_description_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Dataset_created(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_created(ctx, field) +func (ec *executionContext) _DatasetComplete_created(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_created(ctx, field) if err != nil { return graphql.Null } @@ -8061,9 +10373,9 @@ func (ec *executionContext) _Dataset_created(ctx context.Context, field graphql. return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_created(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8074,8 +10386,8 @@ func (ec *executionContext) fieldContext_Dataset_created(ctx context.Context, fi return fc, nil } -func (ec *executionContext) _Dataset_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_lastModified(ctx, field) +func (ec *executionContext) _DatasetComplete_lastModified(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_lastModified(ctx, field) if err != nil { return graphql.Null } @@ -8105,9 +10417,9 @@ func (ec *executionContext) _Dataset_lastModified(ctx context.Context, field gra return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_lastModified(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8118,8 +10430,8 @@ func (ec *executionContext) fieldContext_Dataset_lastModified(ctx context.Contex return fc, nil } -func (ec *executionContext) _Dataset_repo(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_repo(ctx, field) +func (ec *executionContext) _DatasetComplete_repo(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_repo(ctx, field) if err != nil { return graphql.Null } @@ -8146,9 +10458,9 @@ func (ec *executionContext) _Dataset_repo(ctx context.Context, field graphql.Col return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_repo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_repo(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8159,8 +10471,8 @@ func (ec *executionContext) fieldContext_Dataset_repo(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Dataset_pii(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_pii(ctx, field) +func (ec *executionContext) _DatasetComplete_pii(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_pii(ctx, field) if err != nil { return graphql.Null } @@ -8190,9 +10502,9 @@ func (ec *executionContext) _Dataset_pii(ctx context.Context, field graphql.Coll return ec.marshalNPiiLevel2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐPiiLevel(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_pii(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_pii(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8203,8 +10515,8 @@ func (ec *executionContext) fieldContext_Dataset_pii(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Dataset_keywords(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_keywords(ctx, field) +func (ec *executionContext) _DatasetComplete_keywords(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_keywords(ctx, field) if err != nil { return graphql.Null } @@ -8234,9 +10546,9 @@ func (ec *executionContext) _Dataset_keywords(ctx context.Context, field graphql return ec.marshalNString2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_keywords(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8247,8 +10559,8 @@ func (ec *executionContext) fieldContext_Dataset_keywords(ctx context.Context, f return fc, nil } -func (ec *executionContext) _Dataset_owner(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_owner(ctx, field) +func (ec *executionContext) _DatasetComplete_owner(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_owner(ctx, field) if err != nil { return graphql.Null } @@ -8261,7 +10573,7 @@ func (ec *executionContext) _Dataset_owner(ctx context.Context, field graphql.Co }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Owner(rctx, obj) + return obj.Owner, nil }) if err != nil { ec.Error(ctx, err) @@ -8278,12 +10590,12 @@ func (ec *executionContext) _Dataset_owner(ctx context.Context, field graphql.Co return ec.marshalNOwner2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐOwner(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_owner(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "group": @@ -8303,8 +10615,8 @@ func (ec *executionContext) fieldContext_Dataset_owner(ctx context.Context, fiel return fc, nil } -func (ec *executionContext) _Dataset_slug(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_slug(ctx, field) +func (ec *executionContext) _DatasetComplete_slug(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_slug(ctx, field) if err != nil { return graphql.Null } @@ -8334,9 +10646,9 @@ func (ec *executionContext) _Dataset_slug(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_slug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_slug(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8347,8 +10659,8 @@ func (ec *executionContext) fieldContext_Dataset_slug(ctx context.Context, field return fc, nil } -func (ec *executionContext) _Dataset_datasource(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_datasource(ctx, field) +func (ec *executionContext) _DatasetComplete_datasource(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_datasource(ctx, field) if err != nil { return graphql.Null } @@ -8361,7 +10673,7 @@ func (ec *executionContext) _Dataset_datasource(ctx context.Context, field graph }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Datasource(rctx, obj) + return obj.Datasource, nil }) if err != nil { ec.Error(ctx, err) @@ -8378,12 +10690,12 @@ func (ec *executionContext) _Dataset_datasource(ctx context.Context, field graph return ec.marshalNDatasource2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasource(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_datasource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_datasource(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type Datasource does not have child fields") }, @@ -8391,8 +10703,8 @@ func (ec *executionContext) fieldContext_Dataset_datasource(ctx context.Context, return fc, nil } -func (ec *executionContext) _Dataset_access(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_access(ctx, field) +func (ec *executionContext) _DatasetComplete_access(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_access(ctx, field) if err != nil { return graphql.Null } @@ -8405,7 +10717,7 @@ func (ec *executionContext) _Dataset_access(ctx context.Context, field graphql.C }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Access(rctx, obj) + return obj.Access, nil }) if err != nil { ec.Error(ctx, err) @@ -8422,12 +10734,12 @@ func (ec *executionContext) _Dataset_access(ctx context.Context, field graphql.C return ec.marshalNAccess2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐAccessᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_access(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_access(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": @@ -8453,8 +10765,8 @@ func (ec *executionContext) fieldContext_Dataset_access(ctx context.Context, fie return fc, nil } -func (ec *executionContext) _Dataset_services(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_services(ctx, field) +func (ec *executionContext) _DatasetComplete_services(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_services(ctx, field) if err != nil { return graphql.Null } @@ -8467,7 +10779,7 @@ func (ec *executionContext) _Dataset_services(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Services(rctx, obj) + return obj.Services, nil }) if err != nil { ec.Error(ctx, err) @@ -8484,12 +10796,12 @@ func (ec *executionContext) _Dataset_services(ctx context.Context, field graphql return ec.marshalNDatasetServices2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetServices(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_services(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "metabase": @@ -8501,8 +10813,8 @@ func (ec *executionContext) fieldContext_Dataset_services(ctx context.Context, f return fc, nil } -func (ec *executionContext) _Dataset_mappings(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_mappings(ctx, field) +func (ec *executionContext) _DatasetComplete_mappings(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_mappings(ctx, field) if err != nil { return graphql.Null } @@ -8515,7 +10827,7 @@ func (ec *executionContext) _Dataset_mappings(ctx context.Context, field graphql }() resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Dataset().Mappings(rctx, obj) + return obj.Mappings, nil }) if err != nil { ec.Error(ctx, err) @@ -8532,12 +10844,12 @@ func (ec *executionContext) _Dataset_mappings(ctx context.Context, field graphql return ec.marshalNMappingService2ᚕgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐMappingServiceᚄ(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_mappings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_mappings(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { return nil, errors.New("field of type MappingService does not have child fields") }, @@ -8545,8 +10857,8 @@ func (ec *executionContext) fieldContext_Dataset_mappings(ctx context.Context, f return fc, nil } -func (ec *executionContext) _Dataset_anonymisation_description(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_anonymisation_description(ctx, field) +func (ec *executionContext) _DatasetComplete_anonymisation_description(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_anonymisation_description(ctx, field) if err != nil { return graphql.Null } @@ -8573,9 +10885,9 @@ func (ec *executionContext) _Dataset_anonymisation_description(ctx context.Conte return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_anonymisation_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_anonymisation_description(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -8586,8 +10898,8 @@ func (ec *executionContext) fieldContext_Dataset_anonymisation_description(ctx c return fc, nil } -func (ec *executionContext) _Dataset_targetUser(ctx context.Context, field graphql.CollectedField, obj *models.Dataset) (ret graphql.Marshaler) { - fc, err := ec.fieldContext_Dataset_targetUser(ctx, field) +func (ec *executionContext) _DatasetComplete_targetUser(ctx context.Context, field graphql.CollectedField, obj *models.DatasetComplete) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_DatasetComplete_targetUser(ctx, field) if err != nil { return graphql.Null } @@ -8614,9 +10926,9 @@ func (ec *executionContext) _Dataset_targetUser(ctx context.Context, field graph return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) fieldContext_Dataset_targetUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DatasetComplete_targetUser(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "Dataset", + Object: "DatasetComplete", Field: field, IsMethod: false, IsResolver: false, @@ -14207,6 +16519,81 @@ func (ec *executionContext) fieldContext_Query_dataproduct(ctx context.Context, return fc, nil } +func (ec *executionContext) _Query_dataproductComplete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_Query_dataproductComplete(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + 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().DataproductComplete(rctx, fc.Args["id"].(uuid.UUID)) + }) + 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.(*models.DataproductComplete) + fc.Result = res + return ec.marshalNDataproductComplete2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDataproductComplete(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_Query_dataproductComplete(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_DataproductComplete_id(ctx, field) + case "name": + return ec.fieldContext_DataproductComplete_name(ctx, field) + case "description": + return ec.fieldContext_DataproductComplete_description(ctx, field) + case "created": + return ec.fieldContext_DataproductComplete_created(ctx, field) + case "lastModified": + return ec.fieldContext_DataproductComplete_lastModified(ctx, field) + case "slug": + return ec.fieldContext_DataproductComplete_slug(ctx, field) + case "owner": + return ec.fieldContext_DataproductComplete_owner(ctx, field) + case "keywords": + return ec.fieldContext_DataproductComplete_keywords(ctx, field) + case "datasets": + return ec.fieldContext_DataproductComplete_datasets(ctx, field) + } + return nil, fmt.Errorf("no field named %q was found under type DataproductComplete", 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_dataproductComplete_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + ec.Error(ctx, err) + return fc, err + } + return fc, nil +} + func (ec *executionContext) _Query_dataproducts(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { fc, err := ec.fieldContext_Query_dataproducts(ctx, field) if err != nil { @@ -21963,6 +24350,13 @@ func (ec *executionContext) _Datasource(ctx context.Context, sel ast.SelectionSe return graphql.Null } return ec._BigQuery(ctx, sel, obj) + case models.BigQueryComplete: + return ec._BigQueryComplete(ctx, sel, &obj) + case *models.BigQueryComplete: + if obj == nil { + return graphql.Null + } + return ec._BigQueryComplete(ctx, sel, obj) default: panic(fmt.Errorf("unexpected type %T", obj)) } @@ -22373,6 +24767,93 @@ func (ec *executionContext) _BigQuery(ctx context.Context, sel ast.SelectionSet, return out } +var bigQueryCompleteImplementors = []string{"BigQueryComplete", "Datasource"} + +func (ec *executionContext) _BigQueryComplete(ctx context.Context, sel ast.SelectionSet, obj *models.BigQueryComplete) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, bigQueryCompleteImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BigQueryComplete") + case "id": + out.Values[i] = ec._BigQueryComplete_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "projectID": + out.Values[i] = ec._BigQueryComplete_projectID(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "dataset": + out.Values[i] = ec._BigQueryComplete_dataset(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "table": + out.Values[i] = ec._BigQueryComplete_table(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "schema": + out.Values[i] = ec._BigQueryComplete_schema(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "lastModified": + out.Values[i] = ec._BigQueryComplete_lastModified(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "created": + out.Values[i] = ec._BigQueryComplete_created(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "expires": + out.Values[i] = ec._BigQueryComplete_expires(ctx, field, obj) + case "tableType": + out.Values[i] = ec._BigQueryComplete_tableType(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "description": + out.Values[i] = ec._BigQueryComplete_description(ctx, field, obj) + if out.Values[i] == graphql.Null { + out.Invalids++ + } + case "piiTags": + out.Values[i] = ec._BigQueryComplete_piiTags(ctx, field, obj) + case "missingSince": + out.Values[i] = ec._BigQueryComplete_missingSince(ctx, field, obj) + case "pseudoColumns": + out.Values[i] = ec._BigQueryComplete_pseudoColumns(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var bigQuerySourceImplementors = []string{"BigQuerySource"} func (ec *executionContext) _BigQuerySource(ctx context.Context, sel ast.SelectionSet, obj *models.BigQuerySource) graphql.Marshaler { @@ -22578,13 +25059,93 @@ func (ec *executionContext) _Dataproduct(ctx context.Context, sel ast.SelectionS return innerFunc(ctx, dfs) }) - // don't run the out.Concurrently() call below - out.Values[i] = graphql.Null - continue - } + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "datasets": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Dataproduct_datasets(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "datasets": +var dataproductCompleteImplementors = []string{"DataproductComplete"} + +func (ec *executionContext) _DataproductComplete(ctx context.Context, sel ast.SelectionSet, obj *models.DataproductComplete) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataproductCompleteImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DataproductComplete") + case "id": + out.Values[i] = ec._DataproductComplete_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._DataproductComplete_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -22593,7 +25154,7 @@ func (ec *executionContext) _Dataproduct(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Dataproduct_datasets(ctx, field, obj) + res = ec._DataproductComplete_description(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -22620,6 +25181,36 @@ func (ec *executionContext) _Dataproduct(ctx context.Context, sel ast.SelectionS } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "created": + out.Values[i] = ec._DataproductComplete_created(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "lastModified": + out.Values[i] = ec._DataproductComplete_lastModified(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "slug": + out.Values[i] = ec._DataproductComplete_slug(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + out.Values[i] = ec._DataproductComplete_owner(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "keywords": + out.Values[i] = ec._DataproductComplete_keywords(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "datasets": + out.Values[i] = ec._DataproductComplete_datasets(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -22975,6 +25566,147 @@ func (ec *executionContext) _Dataset(ctx context.Context, sel ast.SelectionSet, return out } +var datasetCompleteImplementors = []string{"DatasetComplete"} + +func (ec *executionContext) _DatasetComplete(ctx context.Context, sel ast.SelectionSet, obj *models.DatasetComplete) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, datasetCompleteImplementors) + + out := graphql.NewFieldSet(fields) + deferred := make(map[string]*graphql.FieldSet) + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DatasetComplete") + case "id": + out.Values[i] = ec._DatasetComplete_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "dataproductID": + out.Values[i] = ec._DatasetComplete_dataproductID(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "name": + out.Values[i] = ec._DatasetComplete_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "description": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._DatasetComplete_description(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return innerFunc(ctx, dfs) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } + + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + case "created": + out.Values[i] = ec._DatasetComplete_created(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "lastModified": + out.Values[i] = ec._DatasetComplete_lastModified(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "repo": + out.Values[i] = ec._DatasetComplete_repo(ctx, field, obj) + case "pii": + out.Values[i] = ec._DatasetComplete_pii(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "keywords": + out.Values[i] = ec._DatasetComplete_keywords(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "owner": + out.Values[i] = ec._DatasetComplete_owner(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "slug": + out.Values[i] = ec._DatasetComplete_slug(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "datasource": + out.Values[i] = ec._DatasetComplete_datasource(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "access": + out.Values[i] = ec._DatasetComplete_access(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "services": + out.Values[i] = ec._DatasetComplete_services(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "mappings": + out.Values[i] = ec._DatasetComplete_mappings(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&out.Invalids, 1) + } + case "anonymisation_description": + out.Values[i] = ec._DatasetComplete_anonymisation_description(ctx, field, obj) + case "targetUser": + out.Values[i] = ec._DatasetComplete_targetUser(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch(ctx) + if out.Invalids > 0 { + return graphql.Null + } + + atomic.AddInt32(&ec.deferred, int32(len(deferred))) + + for label, dfs := range deferred { + ec.processDeferredGroup(graphql.DeferredGroup{ + Label: label, + Path: graphql.GetPath(ctx), + FieldSet: dfs, + Context: ctx, + }) + } + + return out +} + var datasetServicesImplementors = []string{"DatasetServices"} func (ec *executionContext) _DatasetServices(ctx context.Context, sel ast.SelectionSet, obj *models.DatasetServices) graphql.Marshaler { @@ -24371,6 +27103,28 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) + case "dataproductComplete": + field := field + + innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_dataproductComplete(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&fs.Invalids, 1) + } + return res + } + + rrm := func(ctx context.Context) graphql.Marshaler { + return ec.OperationContext.RootResolverMiddleware(ctx, + func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + } + out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "dataproducts": field := field @@ -26893,6 +29647,20 @@ func (ec *executionContext) marshalNDataproduct2ᚖgithubᚗcomᚋnaviktᚋnada return ec._Dataproduct(ctx, sel, v) } +func (ec *executionContext) marshalNDataproductComplete2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDataproductComplete(ctx context.Context, sel ast.SelectionSet, v models.DataproductComplete) graphql.Marshaler { + return ec._DataproductComplete(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDataproductComplete2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDataproductComplete(ctx context.Context, sel ast.SelectionSet, v *models.DataproductComplete) 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._DataproductComplete(ctx, sel, v) +} + func (ec *executionContext) marshalNDataset2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDataset(ctx context.Context, sel ast.SelectionSet, v models.Dataset) graphql.Marshaler { return ec._Dataset(ctx, sel, &v) } @@ -26951,6 +29719,60 @@ func (ec *executionContext) marshalNDataset2ᚖgithubᚗcomᚋnaviktᚋnadaᚑba return ec._Dataset(ctx, sel, v) } +func (ec *executionContext) marshalNDatasetComplete2ᚕᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetCompleteᚄ(ctx context.Context, sel ast.SelectionSet, v []*models.DatasetComplete) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNDatasetComplete2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetComplete(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + +func (ec *executionContext) marshalNDatasetComplete2ᚖgithubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetComplete(ctx context.Context, sel ast.SelectionSet, v *models.DatasetComplete) 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._DatasetComplete(ctx, sel, v) +} + func (ec *executionContext) marshalNDatasetServices2githubᚗcomᚋnaviktᚋnadaᚑbackendᚋpkgᚋgraphᚋmodelsᚐDatasetServices(ctx context.Context, sel ast.SelectionSet, v models.DatasetServices) graphql.Marshaler { return ec._DatasetServices(ctx, sel, &v) } diff --git a/pkg/graph/models/dataproduct_complete.go b/pkg/graph/models/dataproduct_complete.go new file mode 100644 index 00000000..be776498 --- /dev/null +++ b/pkg/graph/models/dataproduct_complete.go @@ -0,0 +1,23 @@ +package models + +type DatasetComplete struct { + Dataset + Mappings []MappingService `json:"mappings"` + Access []*Access `json:"access"` + Owner *Owner `json:"owner"` + Services *DatasetServices `json:"datasetServices"` + Datasource Datasource `json:"datasource"` +} + +type BigQueryComplete struct { + BigQuery + Schema []*TableColumn `json:"schema"` +} + +func (BigQueryComplete) IsDatasource() {} + +type DataproductComplete struct { + Dataproduct + Datasets []*DatasetComplete `json:"datasets"` + Keywords []string `json:"keywords"` +} diff --git a/pkg/graph/productAreas.resolvers.go b/pkg/graph/productAreas.resolvers.go index bd808ef9..55cc15ec 100644 --- a/pkg/graph/productAreas.resolvers.go +++ b/pkg/graph/productAreas.resolvers.go @@ -143,7 +143,5 @@ func (r *Resolver) ProductArea() generated.ProductAreaResolver { return &product // Team returns generated.TeamResolver implementation. func (r *Resolver) Team() generated.TeamResolver { return &teamResolver{r} } -type ( - productAreaResolver struct{ *Resolver } - teamResolver struct{ *Resolver } -) +type productAreaResolver struct{ *Resolver } +type teamResolver struct{ *Resolver } diff --git a/profiling.txt b/profiling.txt new file mode 100644 index 00000000..3265c434 --- /dev/null +++ b/profiling.txt @@ -0,0 +1,455 @@ +STORAGE_EMULATOR_HOST=http://localhost:8082/storage/v1/ GCP_QUARTO_STORAGE_BUCKET_NAME=nada-quarto-storage-dev DASHBOARD_PA_ID=Mocked-001 go run ./cmd/nada-backend \ +--bind-address=127.0.0.1:8080 \ +--hostname=localhost \ +--mock-auth \ +--skip-metadata-sync \ +--quarto-bucket=nada-quarto-storage-dev \ +--log-level=debug \ +--slack-token= +ExecContext called with query: ClearTeamProjectsCache and args: [] +QueryRowContext called with query: AddTeamProject and args: [team team-dev-1337] +QueryRowContext called with query: AddTeamProject and args: [nada dataplattform-dev-9da3] +QueryRowContext called with query: AddTeamProject and args: [aura aura-dev-d9f5] +QueryContext called with query: ListUnrevokedExpiredAccessEntries and args: [] +ExecContext called with query: CleanupStoryDrafts and args: [] +QueryContext called with query: GetJoinableViewsToBeDeletedWithRefDatasource and args: [] +QueryContext called with query: GetJoinableViewsWithReference and args: [] +QueryContext called with query: GetPseudoDatasourcesToDelete and args: [] +GraphQL Query: query Dataproduct($id: ID!, $rawDesc: Boolean) { + dataproduct(id: $id) { + id + lastModified + name + description(raw: $rawDesc) + created + slug + owner { + group + teamkatalogenURL + teamContact + productAreaID + teamID + __typename + } + keywords + datasets { + id + dataproductID + lastModified + name + description + created + repo + slug + pii + keywords + mappings + anonymisation_description + targetUser + services { + metabase + __typename + } + owner { + group + teamkatalogenURL + teamContact + __typename + } + access { + id + subject + granter + expires + created + revoked + accessRequestID + accessRequest { + id + polly { + id + name + externalID + url + __typename + } + __typename + } + __typename + } + datasource { + type: __typename + ... on BigQuery { + projectID + dataset + table + lastModified + created + expires + tableType + description + schema { + name + description + mode + type + __typename + } + piiTags + pseudoColumns + __typename + } + } + __typename + } + owner { + group + teamkatalogenURL + teamContact + __typename + } + __typename + } +}, Variables: map[id:eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryContext called with query: GetDatasetsInDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryContext called with query: GetDatasetsInDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetBigqueryDatasource and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514 false] +QueryRowContext called with query: GetMetabaseMetadata and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514] +QueryRowContext called with query: GetBigqueryDatasource and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetDatasetMappings and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f] +QueryRowContext called with query: GetMetabaseMetadata and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f] +QueryRowContext called with query: GetDatasetMappings and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514] +QueryRowContext called with query: GetBigqueryDatasource and args: [10757585-0089-4ce6-b77a-f9ed81894d8b false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetMetabaseMetadata and args: [10757585-0089-4ce6-b77a-f9ed81894d8b] +QueryContext called with query: ListAccessToDataset and args: [10757585-0089-4ce6-b77a-f9ed81894d8b] +QueryContext called with query: ListAccessToDataset and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryContext called with query: ListAccessToDataset and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514] +QueryRowContext called with query: GetDatasetMappings and args: [10757585-0089-4ce6-b77a-f9ed81894d8b] +QueryRowContext called with query: GetBigqueryDatasource and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514 false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetBigqueryDatasource and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetBigqueryDatasource and args: [10757585-0089-4ce6-b77a-f9ed81894d8b false] +GraphQL Query: query searchContent($q: SearchQuery!) { + search(q: $q) { + excerpt + result { + ... on Dataproduct { + __typename + id + name + description + created + lastModified + keywords + slug + datasets { + name + datasource { + type: __typename + ... on BigQuery { + lastModified + __typename + } + } + __typename + } + owner { + group + teamkatalogenURL + teamContact + __typename + } + } + __typename + } + __typename + } +}, Variables: map[q:map[limit:6]] +QueryContext called with query: Search and args: [ 0xc000930ea0 0xc000930eb8 0xc000930ed0 0xc000930ee8 0xc000930f18 0 6] +QueryContext called with query: GetDataproductsByIDs and args: [{[cf0fcca8-46e3-432b-9940-672b0218eecf a5822b1a-c9d4-4796-9010-4bf5cc74a858 e6c2896c-f625-4892-ae05-3cf846ad285e 81dd8d1a-3134-41b0-b42c-c53eede72902 44a535fa-8dc2-4b43-99d5-7c4bb7fc8b8c da60f5d5-86bd-469c-ba8c-7d61b7f5a393]}] +QueryContext called with query: GetStoriesByIDs and args: [{[]}] +QueryContext called with query: GetQuartoStoriesByIDs and args: [{[]}] +QueryContext called with query: GetDatasetsInDataproduct and args: [cf0fcca8-46e3-432b-9940-672b0218eecf] +QueryContext called with query: GetDatasetsInDataproduct and args: [da60f5d5-86bd-469c-ba8c-7d61b7f5a393] +QueryContext called with query: GetDatasetsInDataproduct and args: [44a535fa-8dc2-4b43-99d5-7c4bb7fc8b8c] +QueryContext called with query: GetDatasetsInDataproduct and args: [44a535fa-8dc2-4b43-99d5-7c4bb7fc8b8c] +QueryContext called with query: GetDatasetsInDataproduct and args: [da60f5d5-86bd-469c-ba8c-7d61b7f5a393] +QueryContext called with query: GetDatasetsInDataproduct and args: [cf0fcca8-46e3-432b-9940-672b0218eecf] +QueryContext called with query: GetDatasetsInDataproduct and args: [a5822b1a-c9d4-4796-9010-4bf5cc74a858] +QueryContext called with query: GetDatasetsInDataproduct and args: [a5822b1a-c9d4-4796-9010-4bf5cc74a858] +QueryContext called with query: GetDatasetsInDataproduct and args: [e6c2896c-f625-4892-ae05-3cf846ad285e] +QueryContext called with query: GetDatasetsInDataproduct and args: [e6c2896c-f625-4892-ae05-3cf846ad285e] +QueryContext called with query: GetDatasetsInDataproduct and args: [81dd8d1a-3134-41b0-b42c-c53eede72902] +QueryContext called with query: GetDatasetsInDataproduct and args: [81dd8d1a-3134-41b0-b42c-c53eede72902] +QueryRowContext called with query: GetBigqueryDatasource and args: [e9f14bab-0fb4-4af9-ad7a-612fcb5323e5 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [c3657abe-3ee5-45ef-a0ae-6eadcb84dc09 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [2cc1e41c-3010-4367-af65-1aecb0ee9f8a false] +QueryRowContext called with query: GetBigqueryDatasource and args: [8083932f-b49f-41de-9867-f33bbb2a2a99 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [15c6d5e5-4008-4a54-a4c0-3f6468a67ce8 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [9441da59-df24-483f-bd4d-a312da3827f9 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [42eecfc7-4762-4ca1-979b-8531de3545e8 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [f43fa708-0402-4758-bd59-d46a1efe449e false] +QueryRowContext called with query: GetBigqueryDatasource and args: [013a091b-10c6-4bbd-a065-3899049071e1 false] +QueryRowContext called with query: GetBigqueryDatasource and args: [caee3761-33a1-4f8b-94d2-b7288f2953e4 false] +GraphQL Query: query Dataproduct($id: ID!, $rawDesc: Boolean) { + dataproduct(id: $id) { + id + lastModified + name + description(raw: $rawDesc) + created + slug + owner { + group + teamkatalogenURL + teamContact + productAreaID + teamID + __typename + } + keywords + datasets { + id + dataproductID + lastModified + name + description + created + repo + slug + pii + keywords + mappings + anonymisation_description + targetUser + services { + metabase + __typename + } + owner { + group + teamkatalogenURL + teamContact + __typename + } + access { + id + subject + granter + expires + created + revoked + accessRequestID + accessRequest { + id + polly { + id + name + externalID + url + __typename + } + __typename + } + __typename + } + datasource { + type: __typename + ... on BigQuery { + projectID + dataset + table + lastModified + created + expires + tableType + description + schema { + name + description + mode + type + __typename + } + piiTags + pseudoColumns + __typename + } + } + __typename + } + owner { + group + teamkatalogenURL + teamContact + __typename + } + __typename + } +}, Variables: map[id:eba004e6-22e4-43b2-a57c-3acf287242aa rawDesc:false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +GraphQL Query: query userInfoDetails { + userInfo { + name + email + dataproducts { + id + name + keywords + slug + owner { + group + __typename + } + __typename + } + accessable { + owned { + id + name + dataproduct { + name + slug + __typename + } + dataproductID + keywords + slug + owner { + group + __typename + } + __typename + } + granted { + id + name + dataproduct { + name + slug + __typename + } + dataproductID + keywords + slug + owner { + group + __typename + } + __typename + } + __typename + } + loginExpiration + groups { + name + email + __typename + } + nadaTokens { + team + token + __typename + } + googleGroups { + name + email + __typename + } + allGoogleGroups { + name + email + __typename + } + gcpProjects { + id + group { + name + email + __typename + } + __typename + } + stories { + id + name + keywords + owner { + group + teamkatalogenURL + __typename + } + __typename + } + quartoStories { + id + name + description + keywords + group + teamkatalogenURL + __typename + } + insightProducts { + id + name + description + type + link + keywords + group + teamkatalogenURL + __typename + } + accessRequests { + id + datasetID + subject + subjectType + granter + status + created + expires + owner + polly { + id + name + externalID + url + __typename + } + reason + __typename + } + __typename + } +}, Variables: map[] +QueryContext called with query: GetDatasetsInDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryContext called with query: GetDatasetsInDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetBigqueryDatasource and args: [10757585-0089-4ce6-b77a-f9ed81894d8b false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetDatasetMappings and args: [10757585-0089-4ce6-b77a-f9ed81894d8b] +QueryRowContext called with query: GetBigqueryDatasource and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514 false] +QueryContext called with query: ListAccessToDataset and args: [10757585-0089-4ce6-b77a-f9ed81894d8b] +QueryRowContext called with query: GetBigqueryDatasource and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f false] +QueryRowContext called with query: GetMetabaseMetadata and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f] +QueryRowContext called with query: GetMetabaseMetadata and args: [10757585-0089-4ce6-b77a-f9ed81894d8b] +QueryRowContext called with query: GetDatasetMappings and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f] +QueryRowContext called with query: GetMetabaseMetadata and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514] +QueryContext called with query: ListAccessToDataset and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryContext called with query: ListAccessToDataset and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f] +QueryRowContext called with query: GetDatasetMappings and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514] +QueryRowContext called with query: GetBigqueryDatasource and args: [10757585-0089-4ce6-b77a-f9ed81894d8b false] +QueryRowContext called with query: GetBigqueryDatasource and args: [a6d9e9db-1ab3-4d82-b560-bb936c580a5f false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] +QueryRowContext called with query: GetBigqueryDatasource and args: [8f879dff-7a1d-4215-a3a3-159f68e6b514 false] +QueryRowContext called with query: GetDataproduct and args: [eba004e6-22e4-43b2-a57c-3acf287242aa] diff --git a/schema/dataproducts.graphql b/schema/dataproducts.graphql index 44766bde..9840acd8 100644 --- a/schema/dataproducts.graphql +++ b/schema/dataproducts.graphql @@ -22,6 +22,30 @@ type Dataproduct @goModel(model: "github.com/navikt/nada-backend/pkg/graph/model datasets: [Dataset!]! } +""" +DataproductComplete contains metadata on a datasource. +""" +type DataproductComplete @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DataproductComplete"){ + "id is the identifier for the dataproduct" + id: ID! + "name of the dataproduct" + name: String! + "description of the dataproduct" + description(raw: Boolean): String! @goField(forceResolver: true) + "created is the timestamp for when the dataproduct was created" + created: Time! + "lastModified is the timestamp for when the dataproduct was last modified" + lastModified: Time! + "slug is the dataproduct slug" + slug: String! + "owner of the dataproduct. Changes to the dataproduct can only be done by a member of the owner." + owner: Owner! + "keywords is the keyword tags for the datasets in the dataproduct." + keywords: [String!]! + "datasets is the list of associated datasets." + datasets: [DatasetComplete!]! +} + """ GroupStats contains statistics on a group. """ @@ -41,6 +65,14 @@ extend type Query { id: ID! ): Dataproduct! + """ + dataproductComplete returns the given dataproduct with complete information. + """ + dataproductComplete( + "id of the requested dataproduct." + id: ID! + ): DataproductComplete! + """ dataproducts returns a list of dataproducts. Pagination done using the arguments. """ diff --git a/schema/datasets.graphql b/schema/datasets.graphql index 0c822366..534c7a15 100644 --- a/schema/datasets.graphql +++ b/schema/datasets.graphql @@ -40,6 +40,46 @@ type Dataset @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.Da targetUser: String } +""" +DatasetComplete contains metadata on a dataset. +""" +type DatasetComplete @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DatasetComplete"){ + "id is the identifier for the dataset" + id: ID! + "dataproductID is the id of the dataproduct containing the dataset" + dataproductID: ID! + "name of the dataset" + name: String! + "description of the dataset" + description(raw: Boolean): String! @goField(forceResolver: true) + "created is the timestamp for when the dataset was created" + created: Time! + "lastModified is the timestamp for when the dataset was last modified" + lastModified: Time! + "repo is the url of the repository containing the code to create the dataset" + repo: String + "pii indicates whether it is personal identifiable information in the dataset" + pii: PiiLevel! + "keywords for the dataset used as tags." + keywords: [String!]! + "owner is the owner of the dataproduct containing this dataset" + owner: Owner! + "slug is the dataset slug" + slug: String! + "datasource contains metadata on the datasource" + datasource: Datasource! + "access contains list of users, groups and service accounts which have access to the dataset" + access: [Access!]! + "services contains links to this dataset in other services" + services: DatasetServices! + "mappings services a dataset is exposed to" + mappings: [MappingService!]! + "anonymisation_description explains how the dataset was anonymised, should be null if `pii` isn't anonymised" + anonymisation_description: String + "targetUser is the type of user that the dataset is meant to be used by" + targetUser: String +} + type DatasetServices @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.DatasetServices") { "URL to the dataset in metabase" metabase: String @@ -93,6 +133,39 @@ type BigQuery @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.B } +""" +BigQueryComplete contains metadata on a BigQuery table. +""" +type BigQueryComplete @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.BigQueryComplete") { + "id is the identifier for the datasource" + id: ID! + "projectID is the GCP project ID that contains the BigQuery table" + projectID: String! + "dataset is the dataset that contains the BigQuery table" + dataset: String! + "table name for BigQuery table" + table: String! + "schema for the BigQuery table" + schema: [TableColumn!]! + "lastModified is the time when the table was last modified" + lastModified: Time! + "created is when the table was created" + created: Time! + "expires, if set, is when the table expires" + expires: Time + "tableType is what type the table is" + tableType: BigQueryType! + "description is the description of the BigQuery table" + description: String! + "piiTags is json string from the pii tags map" + piiTags: String + "missingSince, if set, is the time when the table got deleted from BigQuery" + missingSince: Time + "pseudoColumns, if set, the columns are pseudonymised" + pseudoColumns: [String!] + +} + """ PseudoDataset contains information about a pseudo dataset """ @@ -108,7 +181,7 @@ type PseudoDataset @goModel(model: "github.com/navikt/nada-backend/pkg/graph/mod """ Datasource defines types that can be returned as a dataset datasource. """ -union Datasource @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.Datasource") = BigQuery +union Datasource @goModel(model: "github.com/navikt/nada-backend/pkg/graph/models.Datasource") = BigQuery | BigQueryComplete extend type Query { """