Skip to content

RFC: Semantic Introspection#64

Merged
Keweiqu merged 5 commits intographql:mainfrom
PascalSenn:pse/add-semantic-intropsection
Jan 20, 2026
Merged

RFC: Semantic Introspection#64
Keweiqu merged 5 commits intographql:mainfrom
PascalSenn:pse/add-semantic-intropsection

Conversation

@PascalSenn
Copy link
Copy Markdown
Contributor

Proposes a semantic search extension to GraphQL introspection, enabling AI agents to discover API capabilities using natural language.

Comment on lines +151 to +162
```graphql
"""
Union of all introspectable schema members that can be discovered
through semantic search.
"""
union __SchemaMember =
| __Type
| __Field
| __InputValue
| __EnumValue
| __Directive
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gosh I wish we can use @OneOf!!! But okay... Union is the best we have

"""
The matched schema member.
"""
member: __SchemaMember!
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this to something more intuitive like type??

type __SearchResult {
"""
Schema coordinate identifying the matched member.
For example: "Query.user" or "Mutation.createPost(input: )"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should formalize this a bit more. My recommendation is we should omit all args given you have a separate field that specifies arguments

@Keweiqu Keweiqu merged commit 4b967e3 into graphql:main Jan 20, 2026
2 checks passed
@Keweiqu
Copy link
Copy Markdown
Contributor

Keweiqu commented Jan 20, 2026

Some overall thoughts:

  1. we need to flush out the pagination capabilities.
  2. In additional to first: x arg, very often we find it helpful to introduce a min score filter.
  3. How do we distinguish coordinate and pathToRoot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants