# Migration v29

Contains no breaking changes, but is step 1 out of 2 to seamlessly transfer to use Gateway for GraphQL.

## What do you need to do?
1: At the time of writing you can't issue this key automatically - ask in `#api-gateway-support` for keys (for prod and test env) with `GraphQLExplorer` policy. Someone should be able to issue them manually for you. Make it clear you need a SYSTEM key, and name the system you're requesting the keys for. 
2: Add these in your system's vault folders as `GRAPHQL_API_GATEWAY_KEY_{ENV}`. Check all the vault folders and add these as necessary (so if your dev folder only has `MEMBQL_API_KEY_TEST` - old key name - you only need to add the new TEST env key)
3: In the membership config file in the consumer app add to Production Config `graphqlApiGatewayKey: process.env.GRAPHQL_API_GATEWAY_KEY_PROD` and to the Test Config `graphqlApiGatewayKey: process.env.GRAPHQL_API_GATEWAY_KEY_TEST`.
4: If your CI uses the env vars, you will need to add them to the relevant file (`cypress/plugins/setup.js in `next-retention`).

## Changes

`src/graphql.ts` file now has a ternary set up - if we have access to the Gateway Key, use the Gateway setup, otherwise use the old non-Gateway set up. 

A later release will remove this conditional so that only the Gateway setup remains. Although this is a two-step process, it will allow a stress free migration to the new keys. 

Please refer to this [Slack thread](https://financialtimes.slack.com/archives/C06GDS7UJ/p1655288500175669) for more context. 
