Upgrade to a newer API version
Your app stays on its pinned API version until you move it. Run the commands in this guide in your app's directory, where multipaas.json lives.
See what changed
Compare your pinned version with the newest:
multipaas versions diff
It lists the changes in four groups:
- Breaking: a change that can make a request your app already sends fail, such as a removed field or a changed type.
- Dangerous: a change that keeps your requests valid but can change what they do.
- Added: new types and fields. They do not affect what your app sends now.
- Changed: a change that keeps your requests valid and doing what they did, such as a new description or a field that can no longer return null.
An older CLI doesn't list Changed. If multipaas versions diff --help names only "breaking, dangerous and added", run brew update, then brew upgrade multipaas, then run your multipaas versions diff command again, with the same --from and --to if you gave them. Don't read an empty diff from the older CLI as no change.
A renamed field shows as breaking, for the old name, and added, for the new name. For each breaking change, search your code for the type and field it names.
A newer version can bring a whole feature. File fields are one: an app pinned to a version made before them has no file fields in its API, even when the model has them. A newer version brings the File, FileUpload and HttpHeader types and, for each entity with a file field, a field on the entity's own type for each file field, a request<Entity>FileUpload mutation and changes to its create and update mutations. The diff can list each of these as added, dangerous or breaking, depending on what your pinned version had, so read every entry it names for those three types and for those entities. See Files.
Versions made before file fields let an entity or enum have the type name File, FileUpload or HttpHeader. If your model has one (multipaas model show prints each entity's and enum's GraphQL type name in parentheses after its name), MultiPaaS refuses every model change that leaves it in place, and multipaas versions create too, so your newest version stays one made before file fields. If it has more than one, every change to one of them leaves another in place and is refused too, so send feedback instead of changing them. Otherwise, give it another type name first, with multipaas entity update --id ENTITY_ID --type-name NEW_NAME or multipaas enum update --id ENUM_ID --type-name NEW_NAME, using the id that multipaas model show prints. If you no longer need it and nothing uses it, you can delete it instead (entity delete and enum delete need CLI 1.9.0 or later; entity retire and enum retire are the deprecated names and still work). The change makes a new version, so read its diff as above before you move. If the change is refused, read the message. When the name it's about is the type name you gave, or one MultiPaaS makes from it such as updateAsset or AssetPage for Asset, pick another. When a delete is refused because something still uses the entity or enum or links to it, rename it instead. If the rename was already refused, send feedback with both messages. When it names another of File, FileUpload or HttpHeader, one on an entity or enum you didn't change, your model has more than one, so send feedback. When it's unauthorized, you may not change this application's model, so ask someone who can. When it says an entity or enum wasn't found, check the id against multipaas model show and try again. When it's anything else, MultiPaaS has found a second thing the newest version refuses. If you no longer need the entity and haven't had a delete refused, deleting it may clear both. Otherwise, send feedback with the messages.
To see your versions, newest first, run:
multipaas versions list
It prints each version's generator.
To compare two others, pass --from and --to to versions diff, each with an id that versions list printed.
Get newer API features without a model change
MultiPaaS adds API features from time to time, such as list filters, ordering and counts. A version only has the features MultiPaaS had when it was made. If your model hasn't changed since, multipaas versions list ends with "Newer API features are available: run multipaas versions create --app APP_ID", with your application's id. To make a version of the same model with them, run:
multipaas versions create
It prints the new version and does not pin it. Run multipaas versions diff --to VERSION, with VERSION the version it printed, to see what it adds, then move your app as below. If MultiPaaS says the newest version already has the newest features, there is nothing to make. When it's unauthorized, you may not change this application's model, so ask someone who can to run it. If it refuses because the model has a type named File, FileUpload or HttpHeader, rename it as the paragraph about type names above says. If it names another type name, give that entity or enum another one the same way. The rename makes a new version, so run multipaas versions diff --to VERSION, with VERSION the version the rename printed, and move your app to it. versions create needs CLI 1.10.0 or later: run brew update, then brew upgrade multipaas.
Move your app
Do these steps in order. VERSION is the version versions diff printed as to, so you move to the version whose changes you reviewed.
Pin the version.
multipaas pin --api-version VERSIONPull the new schema.
multipaas schema pullRegenerate your code with your own GraphQL codegen.
Fix each breaking change the diff named, and whatever your compiler or type checker reports. Then check each dangerous change it named against what your app expects.
Check that your app sends the new
apiVersionfrommultipaas.jsonin theX-MultiPaaS-App-Api-Versionheader.Run your build and tests.
To stay where you are, change nothing. Read the generated API to learn how versions work.
More
multipaas versions --helplists the version commands.multipaas pin --helpshows how to pin a version.
Using Claude Code? The MultiPaaS plugin does these steps for you.