Skip to content

Duplicate all GraphQL component objects into V1 and V2 namespaces #20679

@bctiemann

Description

@bctiemann

Proposed Changes

Duplicate all GraphQL hierarchy objects (Schema -> Query -> Type -> Filter) to separately named V1 versions.

Justification

Because strawberry requires all objects in the GraphQL hierarchy (Schema -> Query -> Type -> Filter) to be uniquely defined, and complicated by the fact that most of the fields in Type classes are defined using strawberry.lazy which looks in specific files for resolving objects, separating V1 and V2 objects by shortcuts such as subclassing or conditional imports is not feasible. The only reasonable way to keep the V1 and V2 schemas separate within the strawberry object space is to duplicate the entire hierarchy and differentiate them with V1 suffixes, defined in duplicate files with _v1.py.

This will add extra work if GraphQL changes that need to apply to both V1 and V2 arise, but it will incentivize us to deprecate V1.

The upside of this is that when V1 is deprecated, cleaning it up will be almost entirely a matter of deleting the _v1.py files.

Metadata

Metadata

Assignees

Labels

netboxstatus: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions