Tag: graphql
-
Astro dynamic routing (SSR mode) and 404 page
0 I am using Astro and Apollo client to fetch data using GraphQL. In Astro I am using SSR only. I have set up the following Astro dynamic routing (SSR mode): // […slug].astro — import Page from ‘../components/page/Page.astro’; import Layout from ‘../layouts/Layout.astro’; — <Layout title="Test"> <Page /> </Layout> And Page.astro: // Page.astro — import PageOne…
-
GraphQL/APOLLO – Cannot query field “field_name” on type “Query”
0 I am trying to make a query like this in the latest apollo/server 4.9 and graphqlClient – 3.7 like below: const USER_DATA = gql` query getUserData($subdomain: String!) { getUserData(subdomain: $subdomain) { _id full_name email valid_complex_password projects { _id image_url title description street_address city province country } } } but keep getting this: { "errors":…
-
GraphQL mutation in KeystoneJS: “Cannot use ‘in’ operator to search for ‘id’ in undefined”
0 In a KeystoneJS GraphQL project I’m trying to create a new data object (an “Article”) in the ‘resolveInput’ hook of another, existing, data object (a “Proposal” — when a Proposal is approved, I create an Article based on that Proposals’data). This worked fine using the Mongoose adapter, but I’ve tried to do it using…
-
How to implement caching for pagination HOT chocolate?
2 so I want to implement caching. I’m using version 11 hc. Now every time pagination happens there’s requests sent to the database. I want to implement it so the first time a request is made, all the data is retrieved and cached and subsequent requests(going to the next page or previous page) are retrieved…
-
Trying to use redis store with express-session with the help of connect-redis official docs
0 Here’s what I’m trying to do. I’m trying to use redis as store with express-session but get an error : src/index.ts(14,20): error TS7009: ‘new’ expression, whose target lacks a construct signature, implicitly has an ‘any’ type. src/index.ts(15,5): error TS2353: Object literal may only specify known properties, and ‘client’ does not exist in type ‘(options?:…
-
Using GraphQL and relational databases
0 I’ve been using GraphQL for about 2 years now. I’ve been using relational dbs for a long, long time. What I don’t understand is the intended way to use the two together. The summary of my problem is essentially how GQL allows you to ask for what you want, and how that is supposed…
-
In graphQL, the first query always takes longer than the next query for the same query
0 I use GraphQL in my Net core application. I discovered that for the same query, the first query took quite a long time (about 1400ms). But when I query again, the time is only 20ms, the next time too. Why? This is my code [UseDbContext(typeof(StudentManagerContext))] public async Task<List<CourseType>> GetAllCourseUsingDataLoader([ScopedService] StudentManagerContext context) { var stopwatch…
-
Issue with Nullable Types in Hasura GraphQL Schema Generation
0 I am facing an issue with the return types of Hasura queries when generating schemas using the codegen library (via yarn graphql-codegen –config codegen.ts command). Previously, the generated schema used to look like this: schema in graphql.schema.json — { "kind": "OBJECT", "name": "table_name", "description": "columns and relationships of "table_name"", "fields": [ ….. { "name":…
-
Configuring Graphql Resolver with Azure Function and HttpTrigger by POST
0 I have an API Management Service in Azure, there I’m trying to configure my first mutation but I’m having troubles configuring the Resolver Policiy, let me share more details: Here is my mutation: my ResolverPolicy looks like this: <http-data-source> <http-request> <set-method>POST</set-method> <set-url>[URL]</set-url> <set-header name="Content-Type" exists-action="override"> <value>application/json</value> </set-header> <set-body>@{ var args = context.Request.Body.As<JObject>(true)["arguments"]; JObject jsonObject…