timqian / gql-generator

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

how to remove or disable unneeded generated fields #67

Open bastianhilton opened 2 years ago

bastianhilton commented 2 years ago

FIrst of all this plugin is wonderful and just what I was looking for. But question, if I have a query like this:

query findManyAgreements($cursor: AgreementsWhereUniqueInput, $distinct: [AgreementsScalarFieldEnum!], $orderBy: [AgreementsOrderByWithRelationAndSearchRelevanceInput!], $skip: Int, $take: Int, $where: AgreementsWhereInput){
    findManyAgreements(cursor: $cursor, distinct: $distinct, orderBy: $orderBy, skip: $skip, take: $take, where: $where){
        content
        created
        excerpt
        id
        image
        mediamanager
        name
        reference_id
        shop_id
        type
        updated
        user_id
    }
}

and wanted it to be generated as this instead:

query findManyAgreements{
    findManyAgreements{
        content
        created
        excerpt
        id
        image
        mediamanager
        name
        reference_id
        shop_id
        type
        updated
        user_id
    }
}

How would I do that, even if it means to adjust the code in the plugin, just need to know where to look. Thank you in advance.