You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rename id argument name in fields that don’t return its type #4192
There’s one exception to this “rule”. I think it makes sense for us to rename this parameter to make it more consistent:
type Container {
"Initializes this container from this DirectoryID."
- withRootfs(id: DirectoryID!): Container!+ withRootfs(directory: DirectoryID!): Container!
}
Notes
directory is consistent with withDirectory(path: String!, directory: DirectoryID!). withRootfs is similar just with path set to /;
Container.withFS doesn’t matter as it’s deprecated and is going to be removed;
Downside is the breaking change but for codegen clients, withRootfs‘s id being a required argument, the name is hidden from usage so it shouldn’t actually break most users;
@dolanor I'm pretty sure all those optional ids are meant to keep their ID. Have something been added in the meantime?
Your ClientContainerOpts example comes from here:
extendtypeQuery {
""" Load a container from ID. Null ID returns an empty container (scratch). Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host. """container(id: ContainerID, platform: Platform): Container!
}
So we do mean to pass an ID here, to get the corresponding Container object.
changed the title [-]Proposal: Rename `id` argument name in fields that don’t return its type[/-][+]Rename `id` argument name in fields that don’t return its type[/+]on Jul 24, 2023
Activity
dolanor commentedon Jan 5, 2023
I also found that some optional methods parameters are named
idwhen passing the object makes more sense. We should rename them as well.example:
export type ClientContainerOpts = { - id?: ContainerID | Container + id?: Container platform?: Platform }helderco commentedon Jan 5, 2023
@dolanor I'm pretty sure all those optional
ids are meant to keep theirID. Have something been added in the meantime?Your
ClientContainerOptsexample comes from here:So we do mean to pass an ID here, to get the corresponding
Containerobject.gerhard commentedon Jul 18, 2023
We intend to implement this breaking change for:
[-]Proposal: Rename `id` argument name in fields that don’t return its type[/-][+]Rename `id` argument name in fields that don’t return its type[/+]