In graphql what is difference between a `type query` and `extend type query`?

In graphql what is difference between a type query and extend type query?

Ex: difference between

type Query {
    product(id: String!): Product
}

and

extend type Query {
    DeviceDetail(devId: String!): DeviceDetail
}

Will appreciate if you could add an example for your explanation.

  • You can only declare a type once, but you can extend it multiple times

    – 

  • @Bergi – +1. will appreciate if you can add an answer with an example or provide any doc/article reference.

    – 

  • @Bergi – you mean or refer to the schema file. In schema file You can only declare a type once, but you can extend it multiple times. Is this what you mean.

    – 

  • Where else if not in a schema file would you find this code?

    – 

Leave a Comment