GraphQL Argument of `6` in `posts(first: 6)` causes no post edges to be returned
- Linguagem predominante
- JavaScript
- Estrelas
- 48
- Forks
- 48
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
When running this query in the gql playground:
```gql
query GetSeriesList($host: String!, $first: Int!) {
publication(host: $host) {
seriesList(first: $first) {
edges {
node {
id
name
slug
description {
html
}
posts(first: 6) {
edges {
node {
id
title
brief
slug
publishedAt
coverImage {
url
}
author {
name
profilePicture
}
}
}
}
}
}
}
}
}
```
I get the following returned, even though there is one post in the single series in my hashnode blog:
```json
{
"data": {
"publication": {
"seriesList": {
"edges": [
{
"node": {
"id": "...",
"name": "...",
"slug": "...",
"description": {
"html": "..."
},
"posts": {
"edges": []
}
}
}
]
}
}
}
}
```
All I need to do is choose any integer that isn't `6` to get the API to return the expected post edges:
```gql
query GetSeriesList($host: String!, $first: Int!) {
publication(host: $host) {
seriesList(first: $first) {
edges {
node {
id
name
slug
description {
html
}
posts(first: 20) {
edges {
node {
id
title
brief
slug
publishedAt
coverImage {
url
}
author {
name
profilePicture
}
}
}
}
}
}
}
}
}
```
returns:
```json
{
"data": {
"publication": {
"seriesList": {
"edges": [
{
"node": {
"id": "...",
"name": "...",
"slug": "...",
"description": {
"html": "..."
},
"posts": {
"edges": [
{
"node": {
...
}
}
]
}
}
}
]
}
}
}
}
```
Hopefully this behavior is easy to map against the resolver logic.
Guia de contribuição
Direção de pesquisa
Reproduza a query aninhada seriesList/posts no gql playground, comparando posts(first: 6) com os outros valores inteiros exibidos. Em seguida, rastreie a lógica do resolver relevante e verifique também se a query retorna o post edge esperado para first: 6.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- graphql
- Domínio
- api
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 30/100