graphile-utils
to make plugin factories to make doing things a lot easier for people. For example, there really should be an inflector
plugin factory that enables you to override the inflector. Anyway I'm getting ahead of myself.
nodes: [Move]!
node item not marked as not null? [Move!]!
mutation {
updateUserByUserId(input: {userId: "de5f6a1e-58ad-4c54-ab51-55fbca17ba55", userPatch: {address: ""}}) {
user {
userId
name
address
}
}
}
Return {
"errors": [
{
"message": "cannot extract elements from a scalar",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"updateUserByUserId"
]
}
],
"data": {
"updateUserByUserId": null
}
}
totalCount
; the others can be added via plugins but we don't have any official plugins for that yet. I'm planning on adding them at some point in a similar way to computed columns, but using aggregate functions instead. You can also write custom queries or computed columns that do this; for example I just wrote this one:create function XXX_public."items_checklistItemCompletedCount"(i XXX_public.items) returns int as $$
select coalesce(
(select count(*)::int from XXX_public.items where "rootPostId" = i.id AND type = 'CHECKLIST_ITEM' and completed is true),
0
) where i.type = 'POST';
$$ language sql stable;
checklistItemCompletedCount
to the Item
type which does a count. You could replace the count with any aggregate function you like.
CREATE TYPE geo.grouped_value AS (value bigint, label text);
CREATE OR REPLACE FUNCTION geo.planet_osm_polygon_branchesCount(i geo.planet_osm_polygon) RETURNS setof geo.grouped_value AS
KaTeX parse error: Expected 'EOF', got '&' at position 88: WHERE poi.way &̲& i.way GROUP :
SELECT COUNT(*) AS value, shop as label FROM geo.planet_osm_point poi WHERE poi.way && i.way GROUP BY shop ORDER BY COUNT(*) DESC;
LANGUAGE SQL STABLE;