timqian / gql-generator

Generate queries from graphql schema, used for writing api test.
MIT License
374 stars 93 forks source link

Export typescript files #21

Open Hasan-git opened 5 years ago

Hasan-git commented 5 years ago

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
    }
  }
`;
burtyish commented 4 years ago

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