Ejemplo de código JavaScript que usa apollo-client en la interfaz:
function getGql(newVersion) { return gql` mutation TestMutation( $name: String! ${(newVersion)?`$format: Boolean`:``} ) { testMutation( name: $name ${(newVersion)?`format: $format`:``} ) } `; } Pregunta: ¿Puedo interpolar gql-tag para que el método anterior se evalúe como:
gql` mutation TestMutation( $name: String! $format: Boolean ) { testMutation( name: $name format: $format ) } `;o:
gql` mutation TestMutation( $name: String! ) { testMutation( name: $name ) } `; ...basado en el parámetro booleano de getGql() ?