Test-Backed Examples A feature map tied to the Go examples and focused tests that exercise GraphJin behavior. reference reference reference/test-backed-examples reference/test-backed-examples.md

Test-Backed Examples

A feature map tied to the Go examples and focused tests that exercise GraphJin behavior.

Source note: this page is curated from tests/*_test.go, core/**/*_test.go, serv/**/*_test.go, mongodriver/**/*_test.go, and the MCP syntax tests.

Query examples

FeatureTest
Basic queryExample_query in tests/query_test.go
VariablesExample_queryWithVariables
FiltersExample_queryWithWhere1, Example_queryWithWhereIn
Related filtersExample_queryWithWhereOnRelatedTable
JSON path filtersExample_queryJSONPathOperations, Example_queryWithWhereHasAnyKey
Geo filtersExample_queryWithGeoFilter, Example_queryWithGeoContains, TestGeoNear
FragmentsExample_queryWithFragments1
CursorsExample_queryWithNamedCursorPagination
Nested independent cursorsExample_queryWithNestedIndependentCursors
Recursive relationshipsExample_queryWithRecursiveRelationship1
Polymorphic relationshipsExample_queryWithUnionForPolymorphicRelationships
AggregatesExample_queryWithAggregation, Example_queryWithGlobalAggBrokenMdFix
Expression aggregatesExample_queryWithExprMul, Example_queryWithExprBare
Analytics directivesTestAnalytics_DialectRendering, TestAnalytics_DialectUnsupported

Mutation examples

FeatureTest
InsertExample_insert
Bulk insertExample_insertBulk
Nested insertExample_insertIntoMultipleRelatedTables
Connect related rowsExample_insertIntoTableAndConnectToRelatedTables
UpdateExample_update
DeleteTestMultiAliasDelete
Read-only enforcementTestReadOnlyDB_WithRolesAndTables

Integration examples

FeatureTest
OpenAPI joinExample_queryWithOpenAPIJoin
OpenAPI top-level fieldsExample_queryWithOpenAPITopLevel
Multi-database root routingExample_multiDBQueryPostgres, Example_multiDBQuerySQLite, Example_multiDBQueryMongoDB
Multi-database join internalsTestBuildChildGraphQLQueryNestedDatabaseJoin, TestResolveDatabaseJoinsNullID
MongoDB driver DSLTestQueryDSLParsing
MongoDB cursor paginationExample_queryWithNamedCursorPaginationMultiplePages
MCP install/client behaviorTestMCPCLIParity, TestCallTool_ReturnsStructuredContent
MCP cursor IDsTestProcessCursorsForMCP, TestMCP_CursorRoundtripIntegration
MCP OAuthTestMCPOAuthProtectedResourceMetadata
WorkflowsTestRunNamedWorkflow_CanCallGJTools
CodeSQL source discoveryTestMetadataGraphLiveLinksCodeSQLRefs

Use this page to pick examples when writing docs, demos, or regression tests. The examples are part of the test suite, so they are better anchors than invented snippets.

When adding a public feature:

  1. Add or find the test that proves it.
  2. Update the focused docs page.
  3. Update serv/mcp_syntax.go if an AI client needs to learn the syntax.
  4. Add the example to this map when it is broadly useful.
Docs