icgc-argo / roadmap

Place to review/request new features and new tools on ICGC-ARGO's roadmap
1 stars 0 forks source link

Fix validateSubmission gql mutation #1114

Open ciaranschutte opened 4 months ago

ciaranschutte commented 4 months ago

RDPC Gateway Dev ClinicalRegistration mutation is failing for program 'CIA-IE' with error"Cannot return null for non-nullable field Mutation.validateClinicalSubmission.",

Fix query to fail gracefully if results are empty


{
    "errors": [
        {
            "message": "Cannot return null for non-nullable field Mutation.validateClinicalSubmission.",
            "path": [
                "validateClinicalSubmission"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "serviceName": "argo-clinical",
                "query": "mutation($programShortName:String!$submissionVersion:String!){validateClinicalSubmission(programShortName:$programShortName version:$submissionVersion){programShortName state version updatedAt updatedBy clinicalEntities{clinicalType batchName creator createdAt stats{noUpdate new updated errorsFound __typename}records{row fields{name value __typename}__typename}dataUpdates{row field newValue oldValue donorId __typename}dataWarnings{message row field value donorId __typename}dataErrors{message row field value donorId __typename}schemaErrors{message row field value donorId __typename}__typename}fileErrors{message fileNames code __typename}__typename}}",
                "variables": {
                    "programShortName": "CIA-IE",
                    "submissionVersion": "78d81e0c-e748-46b7-8c5d-e87cd49c53f9"
                },
                "stacktrace": [
                    "Error: Cannot return null for non-nullable field Mutation.validateClinicalSubmission.",
                    "    at completeValue (/app/node_modules/graphql/execution/execute.js:605:13)",
                    "    at executeField (/app/node_modules/graphql/execution/execute.js:500:19)",
                    "    at /app/node_modules/graphql/execution/execute.js:377:22",
                    "    at promiseReduce (/app/node_modules/graphql/jsutils/promiseReduce.js:23:9)",
                    "    at executeFieldsSerially (/app/node_modules/graphql/execution/execute.js:373:43)",
                    "    at executeOperation (/app/node_modules/graphql/execution/execute.js:347:14)",
                    "    at execute (/app/node_modules/graphql/execution/execute.js:136:20)",
                    "    at executeIncrementally (/app/node_modules/@apollo/server/dist/cjs/incrementalDeliveryPolyfill.js:47:34)",
                    "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
                    "    at async execute (/app/node_modules/@apollo/server/dist/cjs/requestPipeline.js:223:37)",
                    "    at async processGraphQLRequest (/app/node_modules/@apollo/server/dist/cjs/requestPipeline.js:158:32)",
                    "    at async internalExecuteOperation (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:571:16)",
                    "    at async runHttpQuery (/app/node_modules/@apollo/server/dist/cjs/runHttpQuery.js:121:29)",
                    "    at async runPotentiallyBatchedHttpQuery (/app/node_modules/@apollo/server/dist/cjs/httpBatching.js:36:16)",
                    "    at async ApolloServer.executeHTTPGraphQLRequest (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:483:20)"
                ],
                "exception": {
                    "stacktrace": [
                        "GraphQLError: Cannot return null for non-nullable field Mutation.validateClinicalSubmission.",
                        "    at downstreamServiceError (/appDir/node_modules/@apollo/gateway/dist/executeQueryPlan.js:268:12)",
                        "    at /appDir/node_modules/@apollo/gateway/dist/executeQueryPlan.js:168:57",
                        "    at Array.map (<anonymous>)",
                        "    at sendOperation (/appDir/node_modules/@apollo/gateway/dist/executeQueryPlan.js:168:44)",
                        "    at runMicrotasks (<anonymous>)",
                        "    at processTicksAndRejections (internal/process/task_queues.js:93:5)",
                        "    at async executeFetch (/appDir/node_modules/@apollo/gateway/dist/executeQueryPlan.js:111:41)",
                        "    at async executeNode (/appDir/node_modules/@apollo/gateway/dist/executeQueryPlan.js:82:17)",
                        "    at async Object.executeQueryPlan (/appDir/node_modules/@apollo/gateway/dist/executeQueryPlan.js:22:27)",
                        "    at async Object.ApolloGateway.executor (/appDir/node_modules/@apollo/gateway/dist/index.js:102:30)"
                    ]
                }
            }
        }
    ],
    "data": null
}```