Closed asishallab closed 2 years ago
Error:
{
"data": {
"countAssays": null
},
"errors": [
{
"message": "Cannot read property 'headers' of null",
"locations": [
{
"line": 1,
"column": 2
}
],
"path": [
"countAssays"
]
}
]
}
Migration used:
"use strict";
const dict = require("../utils/graphql-sequelize-types");
const { Sequelize } = require("sequelize");
const { DOWN_MIGRATION } = require("../config/globals");
const fs = require("fs").promises;
/**
* @module - Migrations to create or to drop a table correpondant to a sequelize model.
*/
module.exports = {
/**
* up - Creates a table with the fields specified in the the createTable function.
*
* @param {object} zendro initialized zendro object
*/
up: async (zendro) => {
try {
console.log("====UPLOAD DATA MIGRATION====")
const countTest = await zendro.execute_graphql("{countAssays}") ;
console.log(JSON.stringify(countTest,null,2));
} catch (error) {
console.error(error);
throw Error(error);
}
},
/**
* down - Drop a table.
*
* @param {object} zendro initialized zendro object
*/
down: async (zendro) => {
try {
} catch (error) {
throw new Error(error);
}
},
};
When using our new migration method
executeGraphQL
the above error is generated.Possibly the GraphQL context holding
null
for therequest
attribute is the cause?Please write integration tests, reproducing this error and fix the tests.
Make sure all method of migration work, please