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`?


0

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.

4

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

    – Bergi

    1 hour ago

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

    – cbot

    1 hour ago

  • @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.

    – cbot

    1 hour ago

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

    – Bergi

    1 hour ago


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *