Conversation
…peration types defined
🦋 Changeset detectedLatest commit: 172f3d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 26 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughSummary by CodeRabbitRelease Notes
Summary by CodeRabbit
WalkthroughChanged schema AST printing so schemas with empty operation type arrays are emitted as schema extensions (SCHEMA_EXTENSION) instead of definitions, added a test for federation-style subgraph printing, and included a changeset documenting the patch. Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test
participant Builder as buildSchema
participant Printer as printSchemaWithDirectives
participant AST as astFromSchema
Note over Test,Builder: create subgraph schema with assumeValid/assumeValidSDL
Test->>Builder: buildSchema(SDL, {assumeValid, assumeValidSDL})
Builder-->>Test: GraphQLSchema (no operationTypes)
Test->>Printer: printSchemaWithDirectives(schema)
Printer->>AST: astFromSchema(schema)
alt schema.operationTypes.length > 0
AST->>AST: emit SCHEMA_DEFINITION
else schema.operationTypes.length == 0
AST->>AST: emit SCHEMA_EXTENSION
end
AST-->>Printer: DocumentNode
Printer-->>Test: SDL string with directives (extension printed)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
💻 Website PreviewThe latest changes are available as preview in: https://pr-7679.graphql-tools.pages.dev |
Support "federation/subgraph style" schemas in
astFromSchemaandprintSchemaWithDirectivesIf a
GraphQLSchemadoesn't have any defined operation types, we should print the schema definition as an extension rather than omitting it entirely.They are not a valid schema on their own, but they are valid subgraph schemas in a federation setup, and it is possible to build such schemas with
assumeValidoptions.