GraphQL Types Definition

For example, type is defined as follows:

type Task {
    id: ID!
    title: String!
    completed: Boolean!
}

Request through postman as follows:

Now, Task operations can be performed through GraphQL:

At this point, I want to define a user type as follows:

type User {
    username: String! @id
    name: String
}

If I make the following request through postman:

When the execution is successful, I found that the Task-related GraphQL does not support.

If I send the type definition of Task and User together to initiate a request:

After successful execution, both Task and User-related GraphQL can be executed normally.

I want to know, do all the type definitions have to be executed together?
All my current types are dynamically defined, and it is difficult to put all type definitions together. Is there a better solution?

Hi @junghc
As far as I am concerned you have to put type definitions together. Also I was looking for that for other reasons but could not find a solution to partially update the schema.

Hi @pshaddel
Thank you for your reply, dgraph does not support it, at present, all I can think of is to save each type, and then take it out and execute it every time the type is updated, I hope the official can optimize it.

1 Like