After adding computed columns, GraphQL schema returns empty
See original GitHub issueThis could easily be me not knowing how to create the computed column, or trying to create it in a way that is not supported.
But after I created it the GraphQL schema is blank.
Here are the steps to reproduce it.
CREATE TABLE public.calistings
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
location geometry(Point,4326)
)
CREATE FUNCTION calc_calisting_distance(calisting_row calistings,location json)
RETURNS INTEGER AS $$
SELECT ST_DISTANCE(calisting_row.location::geography, ST_GeomFromGeoJSON(location::text)::geography)::integer
$$ LANGUAGE sql STABLE;
{
"type":"add_computed_field",
"args":{
"table":{
"name":"calistings",
"schema":"public"
},
"name":"distance",
"definition":{
"function":{
"name":"calc_calisting_distance",
"schema":"public"
},
"table_argument":"calisting_row"
}
}
}
After I create the computed column, using the query endpoint. The GraphQL schema, from the intropsection query, is returned blank. If I remove the computed column, the introspection query returns the schema.
Tried checking the logs in the graphql-engine but no error is shown. I can see the introspection query hitting the server and responding with a 200 status OK.
I think the issue might be in the way I am creating the computed column. I didn’t see a way to pass the function arguments to the api. Only the row name and type.
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (5 by maintainers)
thanks @leoalves
I actually found that the issue are not the computed fields themselves. The problem is with the functions. If you untrack the functions, then the schema shows up again and you can still query the computed fields
I support tafelito’s answer, the problem still exists in version v1.1.0-beta.2 And because of this, exporting the scheme to SDL does not work.