timqian/gql-generator

Faulty cross reference detection

westito opened this issue · 0 comments

Generator skips repeating models however those aren't cross references. With "--includeCrossReferences" parameter there is no issue.

Schema:

type OrderDTO {
  payment: PaymentDTO!
  tipPayment: PaymentDTO!
}

type PaymentDTO {
  id: Float!
  user: User!
}

type User {
  id: Int!
  fcmTokens: [FCMToken!]
  invoiceAddress: UserInvoiceAddressInput
}

type FCMToken {
  token: String!
  lastSeen: String!
}

type UserInvoiceAddressInput {
  customerName: String!
  country: String!
  city: String!
  streetAddress: String!
  postalCode: String!
  taxNumber: String
  email: String
}

type Query {
  getOrder(orderId: Int!): OrderDTO!
}

Generation result:

query getOrder($orderId: Int!){
    getOrder(orderId: $orderId){
        payment{
            id
            user{
                id
                fcmTokens{
                    token
                    lastSeen
                }
                invoiceAddress{
                    customerName
                    country
                    city
                    streetAddress
                    postalCode
                    taxNumber
                    email
                }
            }
        }
        tipPayment{
            id
            user{
                id
            }
        }
    }
}