Questions

  • How can I import a route file using Express?

    0 Normally when I make a server I have no problem importing route files but I’m working on a project using GraphQL which requires me to include "type": "module", inside my package.json file. So when I try having this inside my app.js file const indexRouter = require("./routes/index"); It gives me this error. ReferenceError: require is […]

  • WrappedComponent is undefined

    1 I am stuck trying to implement graphql with react-apollo and graphcool. I am following this Tutorial My code with the request query looks like this : import React from ‘react’; import { graphql } from ‘react-apollo’ import gql from ‘graphql-tag’ const ALL_INSPECTIONS_QUERY = gql` # 2 query AllInspectionsQuery { allInspections { id date observation […]

  • NestJS: How to get User from the request in a GraphQL custom Guard which extends from JWT AuthGuard

    4 I use Passport and GraphQL and if I do my own custom guard to get user’s roles it just doesn’t work. I don’t have access to the user from the request in a Guard, is that intentional? I think it should be part of the request (I’m totally new to NestJS), so why I […]

  • Is clang generating incorrect code for inline assembly?

    9 I have some C code: #include "stdio.h" typedef struct num { unsigned long long x; } num; int main(int argc, char **argv) { struct num anum; anum.x = 0; __asm__("movq %%rax, %0n" : "=m" (anum.x) : "rax"(2)); printf("%llun",anum.x); } which I’m compiling and running on my (intel) Mac laptop. The output from the code […]

  • Strapi v4 too much nested data

    5 I’m rewriting strapi v3 queries to v4 (GraphQL), and with new fields ‘data’ and ‘attributes’, I have a problem going too much deep into nested objects, an example of how data looks: user { data { id attributes { company { data { id attributes { location { data { id … } } […]

  • Refetch queries server side after a client side mutation apollo client

    0 I’m using the experimental version of graphql and apollo client together with next13 and at one point in my code I perform a mutation in a client side component to delete data and I need the query that was performed in a server side component to be re-done for the list of results to […]

  • What is ({}) called in C++?

    11 I just read code like this: auto value = ({ auto it = container.find(key); it != container.end() ? it->second : default_value; }); What is this ({}) called? I don’t think I’ve ever seen this before. c++ Share Improve this question Follow edited yesterday Hesky Fisher asked yesterday Hesky FisherHesky Fisher 1,02777 silver badges1111 bronze […]

  • (Gatsby) Displaying frontmatter data in MDX component

    0 I’m trying to create a simple Byline component to use in my MDX posts that displays the site author with a href="mailto:[email protected]" and a time tag with the date the post is given in its frontmatter. I’ve tried following this Gatsby tutorial to learn how to query frontmatter through GraphQL in a component. I […]

  • GraphQL: Subscriptions vs periodic querying to be up to date without refresh?

    2 The bounty expires in 20 hours. Answers to this question are eligible for a +50 reputation bounty. Tony Ngomana is looking for an answer from a reputable source. Imagine that we want to serve a web application to thousands of users. The information on the page should stay up to date even if the […]

  • Cannot access to a disposed context instance

    0 I’m using dotnet 6 with GraphQL 7. I’m having some issues only in one Field. The error appears only when the app is deployed in the cluster (kubernetes), but never in local. So it seems like the Dependency Injection is not working properly, here is the code of the query: public class UserModulesProgressField : […]