Conversation
Adds the `category` field that files a component type under a catalog
category, so a custom type can appear in the Infrastructure catalog
alongside RDS and S3 instead of the components catalog.
Verified against the live API (production and the Zapier sandbox
account) before implementing:
* `category` is a nullable `String` on both `ComponentTypeInput` and
`ComponentType`, not an enum, so no enum type or validator is added.
* It is present in the plain public introspection. The
`GraphQL-Visibility: internal` header is not required.
* Omitting `category` on update leaves the existing value untouched,
which is what makes an already-created type adoptable in place.
The input field is `omitempty`, so a caller that never sets a category
sends nothing at all. The read field is part of the normal selection
set rather than being excluded, otherwise the value could be written
but never reconciled.
Co-authored-by: Cursor <cursoragent@cursor.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds
CategorytoComponentTypeInput(write) andComponentType(read), and addscategoryto theComponentTypeselection set.categoryis a plainStringon both sides, not an enum. Setting it toinfrastructurefiles the component type under the Infrastructure catalog;defaultputs it in Components. I've deliberately not added a validator or enum type — the backend treats categories as account-scoped aliases (the same wayallowedCategorieson relationship definitions does), so a closed set would be wrong.Relationship to #613
This covers the same ground as #613, which was closed unmerged. Two things are different here:
peoplevalue is gone. It isn't creatable in the product, and it's absent from the tests and fixtures.main, so it sits on top of thesystemRelationshipwork rather than conflicting with it.The feature-flag question — please read
@wesleyjellis asked on #613 how this behaves without the feature flag, and I don't think the answer given there was right, so I want to be straight about it rather than paper over it.
The claim was that on a flagless account the field is simply absent and reads "come back as empty". That isn't how GraphQL works: if
categoryisn't in the account's schema, then a query that selects it fails validation outright, and the wholeComponentTyperead errors rather than degrading. The write side genuinely is safe —omitemptymeans nothing is sent when unset — but the read side is not, and that's the part this PR changes.So the risk is specifically: if
infra_component_types_uistill gates schema visibility, this PR breaks everyComponentTyperead on accounts without the flag.What I can confirm is that
categoryis present in the public introspection (noGraphQL-Visibility: internalheader needed) on the account I have access to. What I can't confirm from outside is whether that's because the flag is now on by default for everyone, or just enabled for my account. That's the one thing I need someone with backend visibility to answer:Testing
task ciis green (lint + full suite, 78.4% coverage). Create/update tests sendcategoryand assert it on the response; the list test asserts it's populated across the fixtures.Made with Cursor