-
Notifications
You must be signed in to change notification settings - Fork 374
[graphql] Add @typespec/graphql emitter #11000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
FionaBronwen
wants to merge
131
commits into
microsoft:main
Choose a base branch
from
pinterest:feature/graphql
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
d78ea4f
Run CI against feature branch
timotheeguerin 234e137
Initial setup for graphql emitter (#4978)
swatkatz 2c98981
Add CODEOWNERS for graphql (#5036)
swatkatz 81ad1d5
Merge with main
timotheeguerin aee6340
Adds an emitter shell and sets up the tests to get options (#5033)
swatkatz 73e3fd0
Update package.json with additional metadata (#5076)
steverice cdceeeb
Add `@schema` decorator to mark namespaces as GraphQL schemas (#5159)
steverice 15399b4
Implement `@Interface` and `@compose` decorators
steverice 9279208
Implement `@operationFields` decorator
steverice fedc76b
Merge branch 'main' into feature/graphql
steverice b637f01
Merge branch 'main' into feature/graphql
steverice 7866094
Decorators: @mutation, @query and @sbuscription
AngelEVargas 97fabfe
Adressing comments
AngelEVargas e0ff7f1
Merge pull request #3 from pinterest/interface-and-compose
AngelEVargas b69f3a5
Merge branch 'feature/graphql' into operation-fields-decorator
AngelEVargas 6553a15
Merge pull request #4 from pinterest/operation-fields-decorator
AngelEVargas c14e5ad
Merge branch 'feature/graphql' into feature/avs-opkind-decorators
AngelEVargas 43bcaa3
Merge pull request #16 from pinterest/feature/avs-opkind-decorators
AngelEVargas 5a7a953
Import useStateMap from compiler utils (after merge)
AngelEVargas a206190
Merge pull request #18 from pinterest/feature/avs-delete-statemap-2
AngelEVargas 80e22e5
Merge branch 'main' into feature/graphql
steverice 29cd18d
Update `feature/graphql` to build with latest changes
steverice ef327fb
Rename README to README.md
FionaBronwen eca75ba
Rename README to README.md
FionaBronwen 1763b1d
Merge latest main
bfb8c18
Add main.tsp and remove strict from tspconfig.yml
723e33a
Merge pull request #22 from pinterest/feature/graphql-run-tsp-compiler
swatkatz 8b8dcbc
Add emitter.test.ts
FionaBronwen 0b17d58
Add navigateProgram to parse TSP input
FionaBronwen fbe4b0c
Clean up formatting and comments
FionaBronwen b1dbabe
Clean up spacing and naming
FionaBronwen d39d401
small variable refactor
FionaBronwen 5c7a337
Remove change to .npmrc registry, fix package.json dependencies
FionaBronwen 0f543be
Merge pull request #23 from pinterest/fionabronwen/skeleton-emitter
FionaBronwen f4f96f1
Add GraphQL Emitter to playground website
steverice aa3554c
Add multiple schema support
40122fb
Merge pull request #25 from pinterest/feature/test_multiple_schemas
swatkatz 3e0585c
Update feature/graphql from main
92da1e8
Fix lockfile and dependencies: sync and regenerate pnpm-lock.yaml
9dffec3
Add @schema decorator to main.tsp
FionaBronwen 9797e82
Add schema name, fix bug with schema naming
FionaBronwen b8b93c5
Merge pull request #26 from pinterest/fionabronwen/schema-decorator
FionaBronwen afb67de
Add registry, move main.tsp, update readme.md
FionaBronwen 4187f7f
Update registry interface, add enum registration as an example
FionaBronwen c09f008
Update registry data structures, add exitEnum materialization
FionaBronwen 5562d51
Add check for materialized enum
FionaBronwen 71cd866
Merge pull request #27 from pinterest/fionabronwen/registry
FionaBronwen 763d542
Add TypeMap abstract class (#30)
FionaBronwen e028056
Merge branch 'main' into feature/graphql
steverice 9d2f4cc
Merge branch 'main' into feature/graphql
FionaBronwen 50daaca
Update GraphQL tests to use new testing framework
steverice 3f34bd3
Merge branch 'main' into feature/graphql
steverice 79df3ba
Merge branch 'main' into feature/graphql
FionaBronwen 3d42b02
Merge branch 'main' into feature/graphql
FionaBronwen c2fe95c
Merge branch 'main' into feature/graphql
FionaBronwen d25ea59
[Pinterest Only] Add Agent skills for TypeSpec work
steverice cd3a66e
[Pinterest Only] Adopt shared agent skills
steverice e9e6c56
Vendor the skills from https://github.com/pinternal-dev/agent-skills/…
steverice 13a1c25
Merge branch 'microsoft:main' into main
FionaBronwen c204b15
Merge remote-tracking branch 'origin/main' into feature/graphql
FionaBronwen 3677520
Merge remote-tracking branch 'upstream/main'
steverice 6e682f0
Add mutation engine for TypeSpec-to-GraphQL type transformation (#62)
FionaBronwen b455a23
Add GraphQL ID scalar and built-in name collision warning (#69)
FionaBronwen faa6d3e
Migrate test-host.ts to createTester framework (#68)
FionaBronwen 7276d90
Guard GraphQL built-in scalars from incorrect mutation renaming (#70)
FionaBronwen 96267de
Refactor type-utils.ts for readability and safety (#72)
FionaBronwen fa20db1
Add type-usage and reachability analysis module (#71)
FionaBronwen cc9d4fb
Strip T | null unions in mutation engine via replace() (#73)
FionaBronwen 3f77e30
Fix nullable tracking: mark containers instead of shared type singlet…
FionaBronwen a471bb3
Merge remote-tracking branch 'upstream/main'
steverice b0d7b2a
Add MCP server for TypeSpec documentation and API signatures
swatkatz 982ac8e
Update pnpm-lock.yaml for mcp-server-typespec-docs dependencies
swatkatz ec11f4f
Trigger CI re-run (Preview workflow disabled)
swatkatz 6392d70
Merge pull request #87 from pinterest/feature/mcp-server-docs
swatkatz 6f0bf06
Add naming pipelines, template composition, buildTypeGraph, and print…
swatkatz dfffa28
Simplify isTrueModel to early-return style
swatkatz 7fcaeb3
Merge pull request #88 from pinterest/feature/graphql-naming-mutations
swatkatz 4e9ee51
Add structural transforms: anonymous union naming, collapsing, record…
swatkatz 15ff089
Remove unsafe resolvedType getter in favor of runtime checks
swatkatz 461d146
Extract resolveGraphQLTypeName to shared lib for renderer reuse
swatkatz 4b64ab4
Replace state maps with decorators for mutation engine metadata
FionaBronwen 21abccf
Add Alloy infrastructure, context system, and field components
e26c0b4
Replace legacy emitter with mutation pipeline and TypeGraph output
2ab84e3
Add schema-mutator tests covering filtering and TypeGraph output
607a90e
Remove unnecessary unwrapNullableUnion check from schema-mutator
4ddffc1
Add unreachable check for scalars in schema-mutator
0079c56
Substitute wrapper models into union variant types
swatkatz 8e7d6fc
Add EnumType, ScalarType, UnionType components with tests
swatkatz 91152aa
Mutate input-context models in schema-mutator
swatkatz c7131f0
Fix input/output model splitting to respect type usage
swatkatz 2a3c29e
Add type-name-collision diagnostic for duplicate GraphQL type names
swatkatz 3b602e4
Preserve decorator state on flattened unions via clone
swatkatz b4f2009
Replace unsafe casts with GraphQLUnion interface and typekit guards
swatkatz fc5225e
Merge pull request #89 from pinterest/feature/graphql-structural-tran…
swatkatz 131d037
Merge pull request #79 from pinterest/fionabronwen/graphql-components-1
swatkatz 2c388a2
Merge pull request #90 from pinterest/fionabronwen/graphql-foundation…
swatkatz 16e9fe3
Add Object, Interface, and Input type components with tests
swatkatz 65fe40c
Fix shared decorator arg mutation and exclusive interface logic
swatkatz d7fa6d6
Rename exclusive to interfaceOnly in @Interface decorator
swatkatz 40e7e4d
Merge pull request #93 from pinterest/swatkatz/graphql-components-2
swatkatz 14ba588
Add Schema orchestrator, emitter wiring, and e2e tests
swatkatz 9d1dfe3
Merge pull request #94 from pinterest/swatkatz/graphql-emitter-wiring
swatkatz 5f8580c
Fix @Interface models emitting spurious Output type
swatkatz ff290d8
Merge pull request #96 from pinterest/swatkatz/fix-interface-spurious…
swatkatz 1887ed9
Fix built-in scalars emitted as declarations from nullable unions
swatkatz dda44c6
Merge pull request #97 from pinterest/swatkatz/fix-scalar-string-emis…
swatkatz 81358b0
Fix interface prefix, @compose false diagnostics, and @operationField…
swatkatz 263acac
Use getTypeName for structural type comparison in propertiesEqual
swatkatz 826d592
Fix type-name-collision from union mutations that unwrap to existing …
swatkatz 3d6c34f
Merge pull request #98 from pinterest/swatkatz/fix-finishtype-reinvoc…
swatkatz b846f40
Add visibility filtering with operation-kind-aware input splitting
swatkatz 5796e20
Merge pull request #95 from pinterest/swatkatz/graphql-emitter-wiring
swatkatz c55ad3f
Fix emitter crashes for Record types, nested generics, and union-as-i…
swatkatz 7010924
Merge pull request #99 from pinterest/swatkatz/fix-emitter-crashes
swatkatz e5eeaa2
Add comprehensive e2e manual validation test suite
swatkatz 80d0452
Merge pull request #100 from pinterest/swatkatz/e2e-manual-validation
swatkatz ca18193
Flatten base model fields into child during GraphQL mutation
swatkatz bb1723a
Add graphql-emitter and fix-graphql-bug agent skills
swatkatz 2debeaa
Merge branch 'main' into feature/graphql
swatkatz 7dd6cf1
Merge branch 'feature/graphql' of https://github.com/pinterest/typesp…
swatkatz 8c9b787
Fix @alloy-js/graphql link path after main merge
swatkatz 9a3f793
Merge pull request #101 from pinterest/swatkatz/fix-extends-flattening
swatkatz adc675f
Replace visibility-filtered empty models with scalars
swatkatz 9811f02
Merge pull request #102 from pinterest/swatkatz/fix-empty-visibility-…
swatkatz 3f8cc04
Fix Record<T> scalars duplicated for input/output context (API-5278) …
FionaBronwen 2385929
Prepare GraphQL emitter for upstream PR (#104)
FionaBronwen 44be65b
Merge upstream/main into feature/graphql
FionaBronwen a3a2d57
Fix compatibility issues after upstream merge
FionaBronwen 7d69aac
Remove Pinterest agent skills from feature branch
FionaBronwen 38e3b3c
Address PR review feedback
FionaBronwen 8ab9cf6
Remove unrelated MCP files from PR
FionaBronwen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should also add the emitter to the website |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,3 +243,6 @@ packages/http-client-python/tests/.wheels/ | |
|
|
||
| # Turborepo | ||
| .turbo | ||
|
|
||
| # agents | ||
| .claude/settings.local.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| "strict": true, | ||
| "skipLibCheck": true, | ||
| "isolatedModules": true, | ||
| "composite": true, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think because this needs alloy to build it can't really be composite right? |
||
| "declaration": true, | ||
| "sourceMap": true, | ||
| "declarationMap": true, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Change Log - @typespec/graphql | ||
|
|
||
| ## 0.1.0 | ||
|
|
||
| ### Features | ||
|
|
||
| - Initial release of the GraphQL emitter | ||
| - Support for `@query`, `@mutation`, and `@subscription` operation decorators | ||
| - Support for `@Interface` decorator to mark models as GraphQL interfaces | ||
| - Support for `@compose` decorator to implement interfaces | ||
| - Support for `@operationFields` decorator to add operations to models | ||
| - Support for `@specifiedBy` decorator for custom scalar URLs | ||
| - Automatic input type generation with `Input` suffix | ||
| - `@oneOf` input generation for union-as-input parameters | ||
| - Visibility-based input/output type splitting | ||
| - Union flattening and scalar wrapper generation |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last time we talked I think codeowners couldn't be from outside the organization so we'll have to figure out what we want to do here.