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

Can't query a single entry on URI (GraphQL) #10811

Open
JelmerOT opened this issue Sep 18, 2024 · 0 comments
Open

Can't query a single entry on URI (GraphQL) #10811

JelmerOT opened this issue Sep 18, 2024 · 0 comments
Labels

Comments

@JelmerOT
Copy link

JelmerOT commented Sep 18, 2024

Bug description

I'm trying to query a single entry based on URI with GraphQL. These are the queries I'm using:

query MyQuery {
  entries(site: "nl_nl", collection: "collections") {
    data {
      published
      uri
      site {
        handle
      }
    }
  }
  
  entry(site: "nl_nl", uri: "/c/accessoires") {
    title
  }
}

The results are as follows:

{
  "data": {
    "entries": {
      "data": [
        {
          "published": true,
          "uri": "/c/accessoires",
          "site": {
            "handle": "nl_nl"
          }
        },
        {
          "published": true,
          "uri": "/c/slaapproblemen",
          "site": {
            "handle": "nl_nl"
          }
        },
        {
          "published": true,
          "uri": "/c/stressklachten",
          "site": {
            "handle": "nl_nl"
          }
        },
        {
          "published": true,
          "uri": "/c/overgang",
          "site": {
            "handle": "nl_nl"
          }
        }
      ]
    },
    "entry": null
  }
}

You can clearly see that /c/accessoires is available and published within the entries query. But when I try to fetch this with the entry query I get no results.

The weird thing is once I resave this entry I get the correct result back. Seems like a cache issue? Although my graphql cache is set to false. It also works if I run php artisan statamic:stache:warm.

How to reproduce

  1. Clone Statamic
  2. Create a collection
  3. Add entries to this collection
  4. Use the GraphiQL explorer to reproduce above queries

Logs

No response

Environment

Environment
Application Name: Statamic
Laravel Version: 11.15.0
PHP Version: 8.3.9
Composer Version: 2.6.5
Environment: local
Debug Mode: ENABLED
URL: api.dromenwinkel.com.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.6.1
PHP SDK Version: 4.8.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: NOT SET
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 8
Sites: 3 (Nederlands, English, Canada)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.14.0 PRO

Statamic Addons
aryehraber/statamic-logbook: 3.3.0
orangetalent/statamic-graphql-alternates: dev-dev
orangetalent/statamic-graphql-breadcrumbs: dev-main
orangetalent/statamic-graphql-lang: dev-main
ryanmitchell/statamic-translation-manager: 2.0.0
studio1902/statamic-peak-seo: 8.15.3
studio1902/statamic-peak-tools: 6.3.0
webographen/statamic-admin-log: 1.1.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

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

No branches or pull requests

2 participants