# Migration v31

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

## What do you need to do?
1: Make sure you followed the migration instructions for v29, that PR is merged, and you can see in the Gateway Portal that the new key is being used. 
2: In the membership config file in the consumer app 

a) update the Production Config to read `graphqlApiKey: process.env.GRAPHQL_API_GATEWAY_KEY_PROD` and Test Config to `graphqlApiKey: process.env.GRAPHQL_API_GATEWAY_KEY_TEST` (you are changing the value of `graphqlApiKey` to be that of the new key's reference).

b) remove the lines `graphqlApiGatewayKey: process.env.GRAPHQL_API_GATEWAY_KEY_PROD` and `graphqlApiGatewayKey: process.env.GRAPHQL_API_GATEWAY_KEY_TEST` respectively. 

3: If your CI uses the env vars, you will need to apply changes a) and b) to the relevant file (`cypress/plugins/setup.js in `next-retention`).

4: Delete the non-gateway GraphQL secrets from Vault.

## Changes

`src/graphql.ts` file has the ternary setup removed and is back to the "old" code. The Graphql expects only one secret that is named `graphqlApiKey`.

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