1

Hello guys i want to ask, so i have JSON response like this:

{
    "homeListComponents": [
        {
            "page": 1,
            "listComponents": [
                {
                    "componentName": "HEALTH_PRODUCT",
                    "componentDescription": "Showing health product component"
                },
                {
                    "componentName": "HEALTH_SERVICE",
                    "componentDescription": "Showing health service component"
                },
                {
                    "componentName": "OTHER_HEALTH_SERVICE",
                    "componentDescription": "Showing other health service component"
                }
            ]
        },
        {
            "page": 2,
            ...... //same like above
        },
        {
            "page": 3,
            ...... //same like above
        }
    ]
}

the response was successfully called in graphql using this query:

But, how can i call only page 1 ?

I already tried this query:

But the response is null.

Thank you.

1 Answer 1

1

You need implement your graphql resolver in server-side. It decide what result you will get.

In resolver function, your can get the arguments you passed from client.

For your question, I think you need implement a pagination

See these links:

https://graphql.org/learn/pagination/

https://www.apollographql.com/docs/react/features/pagination.html

https://github.com/mrdulin/apollo-server-express-starter/tree/master/src/pagination

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.