In Galaxy Modeler you can use the copy and paste function to copy types, inputs, interfaces as well as individual properties. Previously it was only possible to copy entire types, now you can conveniently copy one or more selected properties.
Selections and copy & paste
Working with GraphQL types and individual properties is easy. Just use the mouse and the CTRL (Command) key to expand the selection to multiple objects (types, interfaces, inputs…) or multiple properties. Then use the keyboard shortcuts CTRL+C and CTRL+V as usual.
Standard copy & paste
In the diagram you can select a table, then right-click it and select Copy from the context menu.
To insert a copy of the selected GraphQL type into the project, right-click on the main diagram or sub-diagram area and select Paste.
Dependencies and related objects
Inserting a copy of the GraphQL type appears to be a very simple matter. However, if there is a property in the type that uses enum, you will probably want to preserve that specification as well.
You might think, for example:
- How to deal with such dependent objects if the target is a different or completely new project?
- Should the enum also be copied and pasted into the target project?
- What if there is a line that leads to the original object? Should it be added?
You don’t have to ask questions like that,
you don’t have to look for answers.
We offer you the solution.
Let’s take a look at how inserting a copy of a GraphQL type into the same project works and how inserting a copy into a new project behaves.
Pasting into the same project
If you insert a type into the same project, properties that use enum will use the existing element of your existing model. Additionally, the line leading to the original table will also be added to the newly inserted type, as seen in the screenshot below.
Pasting into a new project
If you insert the Character type into a new project, Galaxy Modeler recognizes that the Episode enum does not exist and therefore automatically adds the object to the project. It also adds lines leading to the Character type. You can see the result below:
- Newly added type Character – without modified name, because the type does not exist in the new project.
- Newly added enum Episode
- Newly added line from Episode enum leading to the Character type
It is worth mentioning that the Episode (enum) object was not originally in the selection. We copied only the type Character.
As you can see, Galaxy Modeler recognizes dependent objects and can map them when used in an existing model, or create them when using a new project as a target.
Working with type properties and dependencies
A similar miracle happens if you copy one or more type properties. If this property uses an enum and you paste it into an existing project, it will be correctly mapped to the existing object.
Pasting the property to a type in the same project
Properties selection and copy operation:
Pasting the property to a type in a new project
If you paste it into a type in a new project, the enum will be added to the project.
Deleting multiple properties at once
If you want to move properties from one type to another, use copy and paste and then you can delete the original properties. With the ability to select multiple properties in a type, this is now possible.