-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* generate unions * drop unused TagOwner enums * union tpl clean up
- Loading branch information
1 parent
58c303b
commit 94e2dbd
Showing
7 changed files
with
119 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,40 @@ | ||
{{- define "union" }} | ||
// {{ title .Name }} {{.Desc | clean | endSentence}} | ||
{{- if eq "CheckOwner" .Name }} | ||
{{ template "check_owner" }} | ||
{{- else if eq "EntityOwner" .Name }} | ||
{{ template "entity_owner" }} | ||
{{- else if eq "ServiceDocumentSource" .Name }} | ||
{{ template "service_document_source" }} | ||
{{- else }} | ||
type {{.Name}} struct { | ||
{{ range .TypeNames }} | ||
{{- if not (contains "Group" . ) }} | ||
{{.}} {{. -}} | ||
{{- if not (contains . (list "ApiDocIntegration" "InfrastructureResource" "ServiceRepository" | join " " )) -}}Id | ||
{{- end }} `graphql:"... on {{.}}"` | ||
{{- end }} | ||
{{- end }} | ||
} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{- define "check_owner" -}} | ||
type CheckOwner struct { | ||
Team TeamId `graphql:"... on Team"` | ||
// User UserId `graphql:"... on User"` // TODO: will this be public? | ||
} | ||
{{ end }} | ||
|
||
{{- define "entity_owner" -}} | ||
type EntityOwner struct { | ||
OnTeam EntityOwnerTeam `graphql:"... on Team"` | ||
} | ||
{{ end }} | ||
|
||
{{- define "service_document_source" -}} | ||
type ServiceDocumentSource struct { | ||
IntegrationId `graphql:"... on ApiDocIntegration"` | ||
ServiceRepository `graphql:"... on ServiceRepository"` | ||
} | ||
{{ end }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.