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
Functions in migration files provide a higher level of control and the ability to perform dynamic operations.
exportdefaultasyncfunction(){// Fetch data, execute queries, and perform other asynchronous operations here.// Return content migrations if neededreturn{queries: [// Individual queries]};};
However, it doesn't say how to execute queries from the function. I need to fetch data using a GraphQL query, perform an operation on it (compute slug columns using slugify) and only then return the mutation query that sets the slugs. How can I perform queries from the migration function?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation for content migrations says:
However, it doesn't say how to execute queries from the function. I need to fetch data using a GraphQL query, perform an operation on it (compute
slugcolumns usingslugify) and only then return the mutation query that sets the slugs. How can I perform queries from the migration function?Beta Was this translation helpful? Give feedback.
All reactions