Title: Service resolve error when 'UseConnectionPaging()' · Issue #459 · EntityGraphQL/EntityGraphQL · GitHub
Open Graph Title: Service resolve error when 'UseConnectionPaging()' · Issue #459 · EntityGraphQL/EntityGraphQL
X Title: Service resolve error when 'UseConnectionPaging()' · Issue #459 · EntityGraphQL/EntityGraphQL
Description: Getting an error when trying to resolve service inside query when using UseConnectionPaging extension. How to reproduce (demo project) Define schema (something like #78): demoScashema.Query().ReplaceField("people", "Get a page of people"...
Open Graph Description: Getting an error when trying to resolve service inside query when using UseConnectionPaging extension. How to reproduce (demo project) Define schema (something like #78): demoScashema.Query().Repla...
X Description: Getting an error when trying to resolve service inside query when using UseConnectionPaging extension. How to reproduce (demo project) Define schema (something like #78): demoScashema.Query().Repla...
Opengraph URL: https://github.com/EntityGraphQL/EntityGraphQL/issues/459
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Service resolve error when 'UseConnectionPaging()'","articleBody":"Getting an error when trying to resolve service inside query when using `UseConnectionPaging` extension.\n\n### How to reproduce (demo project)\n\nDefine schema (something like #78):\n```cs\ndemoScashema.Query().ReplaceField(\"people\", \"Get a page of people\").Resolve\u003cIHttpContextAccessor\u003e((ctx, service) =\u003e ctx.People.Where(e =\u003e e.FirstName != service.HttpContext!.User.Identity!.Name)).UseConnectionPaging();\n```\nSend request ` { people { edges { node { id } } } } ` and get error response:\n\n```\n{\n\t\"errors\": [\n\t\t{\n\t\t\t\"message\": \"Field 'people' - variable 'service' of type 'Microsoft.AspNetCore.Http.IHttpContextAccessor' referenced from scope '', but it is not defined\"\n\t\t}\n\t]\n}\n```\nRemove `UseConnectionPaging` and you will get no errors for `{ people { id } }`\n```cs\ndemoSchema.Query().ReplaceField(\"people\", \"Get a page of people\").Resolve\u003cIHttpContextAccessor\u003e((ctx, service) =\u003e ctx.People.Where(e =\u003e e.FirstName != service.HttpContext!.User.Identity!.Name))\n```\n\n","author":{"url":"https://github.com/BRUS1NATOR","@type":"Person","name":"BRUS1NATOR"},"datePublished":"2025-06-03T19:22:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/459/EntityGraphQL/issues/459"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:85b2b740-a202-6e4e-f076-567bdd559c16 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C570:3C0D19:1B9F6D:25F23D:6978ABF3 |
| html-safe-nonce | 17816ea37f7b7155e7136190e38e2096ec84e78b289eb9f7a56ee6a9c9b14887 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTcwOjNDMEQxOToxQjlGNkQ6MjVGMjNEOjY5NzhBQkYzIiwidmlzaXRvcl9pZCI6IjMzNDc3NTc4NDMxMjQ2Mjg0NjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a810c37bf442e9294949be0f0e42e64a57822527a5e23b5d210e8d34449e9a39 |
| hovercard-subject-tag | issue:3115166055 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/EntityGraphQL/EntityGraphQL/459/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d2a67afc23cbbc10cbd45ee9c08f6951587ab2277e2da358ddf5b3b0120b1219/EntityGraphQL/EntityGraphQL/issues/459 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d2a67afc23cbbc10cbd45ee9c08f6951587ab2277e2da358ddf5b3b0120b1219/EntityGraphQL/EntityGraphQL/issues/459 |
| og:image:alt | Getting an error when trying to resolve service inside query when using UseConnectionPaging extension. How to reproduce (demo project) Define schema (something like #78): demoScashema.Query().Repla... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BRUS1NATOR |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/EntityGraphQL/EntityGraphQL git https://github.com/EntityGraphQL/EntityGraphQL.git |
| octolytics-dimension-user_id | 87887288 |
| octolytics-dimension-user_login | EntityGraphQL |
| octolytics-dimension-repository_id | 38514759 |
| octolytics-dimension-repository_nwo | EntityGraphQL/EntityGraphQL |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38514759 |
| octolytics-dimension-repository_network_root_nwo | EntityGraphQL/EntityGraphQL |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8aa86d87c47054170094daaf9699b27a28a8448 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width