Running this query at https://graphql.toolforge.org produces an error:
{ wikidata { entity(id: "Q1297") { claims { mainsnak { datavalue { __typename ... on SnakValueQuantity { SnakValueQuantity: value { amount unit { id } } } } } } } } }
Error:
"message": "Invalid URL: 1", "locations": [ { "line": 11, "column": 17 } ], "path": [ "wikidata", "entity", "claims", 91, "mainsnak", "datavalue", "SnakValueQuantity", "unit" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "exception": { "input": "1", "stacktrace": [ "TypeError [ERR_INVALID_URL]: Invalid URL: 1", " at onParseError (internal/url.js:241:17)", " at parse (internal/url.js:257:3)", " at new URL (internal/url.js:332:5)", " at /data/project/graphql/www/js/types/entity.js:437:14", " at field.resolve (/data/project/graphql/www/js/node_modules/graphql-extensions/dist/index.js:134:26)", " at field.resolve (/data/project/graphql/www/js/node_modules/apollo-server-express/node_modules/apollo-server-core/dist/utils/schemaInstrumentation.js:52:26)", " at resolveFieldValueOrError (/data/project/graphql/www/js/node_modules/graphql/execution/execute.js:467:18)", " at resolveField (/data/project/graphql/www/js/node_modules/graphql/execution/execute.js:434:16)", " at executeFields (/data/project/graphql/www/js/node_modules/graphql/execution/execute.js:275:18)", " at collectAndExecuteSubfields (/data/project/graphql/www/js/node_modules/graphql/execution/execute.js:713:10)" ] } } },
This is because I am asking for the "unit" field and it returns a "1" (String) instead of a link (String) when no unit is specified. It therefore fails to get the entity.