How to create Resolvers for this apollo graphql server

How to create Resolvers for this apollo graphql server


-1

How to Create Resolvers for Apollo GraphQL Server using the Given Output and Type Definitions

{
  "data": {
    "department": [
      {
        "id": "123",
        "booksubdepartment": [
          {
            "id": "111",
            "departmentID": "123",
            "books": [
              {
                "subdepartmentId":"111",
                "bookTitle": "Book One on sub department 111"
              },
              {
                "subdepartmentId":"111",
                "bookTitle": "Book Two on sub department 111"
              }
            ]
          },
          {
            "id": "222",
            "books": [
              {
                "subdepartmentId":"222",
                "bookTitle": "Book one on sub department 222"
              },
              {
                "subdepartmentId":"222",
                "bookTitle": "Book two on sub department 222"
              }
            ]
          }
        ]
      },
      {
        "id": "345",
        "booksubdepartment": [
          {
            "id": "333",
            "departmentID": "345",
            "books": [
              {
                "subdepartmentId":"333",
                "bookTitle": "Book one on sub department 333"
              },
              {
                "subdepartmentId":"333",
                "bookTitle": "Book two on sub department 333"
              }
            ]
          },
          {
            "id": "444",
            "books": [
              {
                "subdepartmentId":"444",
                "bookTitle": "Book one on sub department 444"
              },
              {
                "subdepartmentId":"444",
                "bookTitle": "Book two on sub department 444"
              }
            ]
          }
        ]
      }
    ]
  }
}

types:

type Bookdepartment {
  id:ID
  booksubdepartment: [Booksubdepartment]
}

type Booksubdepartment {
  id:ID
  departmentID: String
  books:[Book]
}

type Book {
  id:ID
  subdepartmentId:String
  bookTitle:String
}

type Query {
  bookdepartments:[Bookdepartment]
}

Share

0

Reset to default



Browse other questions tagged

or ask your own question.

Leave a Reply

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