timqian/gql-generator

Export typescript files

Hasan-git opened this issue · 1 comments

Could you provide a way to export the queries in typescript files ?
Like =>


import gql from 'graphql-tag';

export const ADD_TASK = gql`
mutation createTask($description: String!, $title: String!, $status: TaskStatus){
    createTask(description: $description, title: $title, status: $status){
      id
      title
      description
      version
      status
    }
  }
`;

If you have access to a schema you can generate types from it using https://graphql-code-generator.com/. Is this what you need?