You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Follow-up to #6384/#6453: the GraphQL introspection dispatch still ignores field aliases at five sites, so an aliased __type/__schema query answers wrongly #7036
The #6384 fix taught the query path to resolve a GraphQL field alias, and #6453 swept the top-level dispatch. The introspection dispatch was not swept: five sites still read selection.getField() only and never fall back to getFieldWithAlias(), so an aliased introspection query returns wrong data or a misleading parse error.
getFieldWithAlias occurs twice in the whole file. The five introspection sites all use the bare form:
:456 final Field field = selection.getField(); // executeIntrospectionSchema
:480 final Field field = selection.getField(); // executeIntrospectionType
:516 final Field field = selection.getField(); // buildTypeList
:579 final Field subField = sub.getField(); // buildGraphQLTypeResult
:611 final Field subField = sub.getField(); // buildDatabaseTypeResult
Repro
Three distinct wrong outcomes, all from writing an alias:
{ t: __type(name: "Book") { name } }
executeQuery correctly resolves __type through the alias (:129-130) and dispatches, then field == null at :480, typeName stays null, and :487 throws CommandParsingException("__type query requires a 'name' argument") - for a query that supplied one.
{ s: __schema { queryType { name } } }
selectionSet resolves to null at :456, so the result is an object with no properties instead of the introspection data.
{ __type(name: "Book") { f: fields { name } } }
:579/:611 match sub-selections on sub.getName(), which is the alias when one is written, so fields is silently omitted.
Aliased introspection is not exotic - it is what a client does when it needs two __type lookups in one document, and Apollo-style tooling aliases by habit.
Note on severity vs the original issue
Every one of the five sites is null-guarded, so there is no NPE and no 500 - the symptom is a wrong result or a misleading error, not the crash #6384 was titled for. That is why this is a follow-up rather than a reopen.
Also worth recording: introspection predates the fix (added in ca750dec3, an ancestor of 915cdaf9b), so these are pre-existing siblings the sweep missed rather than newer code that regressed.
Suggested fix
At each of the five sites, resolve the field the way :407-421 already does - field != null ? field : selection.getFieldWithAlias() for both the arguments and the selection set - and compare sub-selection names against the aliased-away field name rather than Selection.getName(). Given the fix already has regression tests for the query path (Issue6384FieldAliasTest, Issue6453TopLevelQueryAliasTest), the natural addition is an aliased-introspection case alongside them.
Scope / confidence
High that the five sites lack the fallback (counted and quoted above). Medium on impact, since it depends on a client writing an alias on an introspection field.
Aliased introspection queries (t: __type(name: "Book"), s: __schema { ... }, f: fields { ... }) now resolve the real field's arguments and selection set. Rather than patching the five sites, the resolution of a plain or aliased selection now lives in one place used by every consumer, so the query and introspection paths cannot drift apart again. Aliased sub-selections are returned under the alias, as the GraphQL spec prescribes.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
Merge pull request #7091 from ArcadeData/fix/issues-6934-7084-7036-70…
lvca commentedon Sep 3, 2026
Fixed in #7091 (26.9.1).
Aliased introspection queries (
t: __type(name: "Book"),s: __schema { ... },f: fields { ... }) now resolve the real field's arguments and selection set. Rather than patching the five sites, the resolution of a plain or aliased selection now lives in one place used by every consumer, so the query and introspection paths cannot drift apart again. Aliased sub-selections are returned under the alias, as the GraphQL spec prescribes.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#6934,ArcadeData#7084,ArcadeData#7036,ArcadeData#7034,A…