Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graph does not see some fields and does not generate the scheme correctly #47

Open
SaiRO97 opened this issue Jun 8, 2020 · 0 comments

Comments

@SaiRO97
Copy link

SaiRO97 commented Jun 8, 2020

Hello, I have categories in the project. I need to get all fields from an endpoint in graphql. But the schema does not generate correctly, the children field at my endpoint always returns an empty array when I make a request

data from server

[
    {
        "id": 1,
        "nameI18nId": 238,
        "slug": "test",
        "name": {
            "id": 238,
            "en": "Test",
            "ru": "Тест"
        },
        "children": [
            {
                "id": 10,
                "nameI18nId": 548,
                "slug": "product-category-name",
                "name": {
                    "id": 548,
                    "en": "product category name",
                    "ru": "категория продукта"
                },
        ]
]

gatsby config file

{
      resolve: `gatsby-source-apiserver`,
      options: {
        url: process.env.PAYFORM_API_URL,
        method: 'get',
        typePrefix: 'internal__',
        name: 'payform',
        headers: {
          'Content-Type': 'application/json',
        },
        verboseOutput: true,
        entitiesArray: [
          {
            url: `${process.env.PAYFORM_API_URL}product`,
            method: 'get',
            headers: {
              'Content-Type': 'application/json',
            },
            typePrefix: 'internal__',
            name: `products`,
          },
          {
            url: `${process.env.PAYFORM_API_URL}product-category`,
            method: 'get',
            headers: {
              'Content-Type': 'application/json',
            },
            typePrefix: 'internal__',
            name: `categories`,
          },
        ],
      },

How can I get data in the children field? If you have any ideas, please let me know how I can fix this. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant