Questions

  • my apollo node js client not working for unknown reason

    0 I have the following nodejs code : const { ApolloClient, InMemoryCache, createHttpLink } = require(‘@apollo/client’); // Define the HTTP endpoint const httpEndpoint = ‘https://localhost:5000/graphql/’; // Create an HTTP link const httpLink = createHttpLink({ uri: httpEndpoint, }); // Create an Apollo Client with the HTTP link const client = new ApolloClient({ link: httpLink, cache: new […]

  • Types conflict when using GraphQL Code generator (codegen)

    1 given the following codegen.ts import type { CodegenConfig } from ‘@graphql-codegen/cli’; const config: CodegenConfig = { overwrite: true, schema: ‘https://mySchema’, documents: ‘src/**/*.ts’, generates: { ‘src/apollo/gql/’: { preset: ‘client’, plugins: [] } } }; export default config; the types generated starting from my schema.json are in conflict. I have a query with the following request: […]

  • How to multiply a INumber with an int?

    7 How should I implement the multiplication by int (z * 2) on the last line. public static TResult Test<TResult>() where TResult : INumber<TResult> { TResult x = TResult.AdditiveIdentity; TResult y = TResult.MultiplicativeIdentity; TResult z = x * y; TResult z2 = z * 2; // <— this gives the CS0019 error "The operator * […]

  • Dependent name in local class

    12 #include <type_traits> template<typename… Ts> void boo() { struct A { struct B {}; }; static_assert(std::is_class_v<A>); static_assert(std::is_class_v<A::B>); // compilation failure; need typename. } int main() { boo<int>(); } Why is A::B a dependent name and A is not? Can not see anything in standard about that. c++ language-lawyer Share Improve this question Follow edited 12 […]

  • Best way to construct a GraphQL query string in Python

    29 I’m trying to do this (see title), but it’s a bit complicated since the string I’m trying to build has to have the following properties: mulitiline contains curly braces I want to inject variables into it Using a normal ””” multiline string makes injecting variables difficult. Using multiple f-strings makes injecting variables easy, but […]

  • Tried to use the environment variable in graphql codegen file

    0 I tried to use the environment variable in the codegen.yml. I decided to generate the codegen.yml file by using the handlebars. yarn add handlebars codegen-template.yml overwrite: true generates: ./src/generated/graphql.tsx: schema: "{{REACT_APP_GRAPHQL_ENDPOINT}}" documents: src/**/*.graphql plugins: – typescript – typescript-operations – typescript-react-apollo package.json "scripts": { "generate-yaml": "npx handlebars -c .env -i codegen-template.yml -o codegen.yml" } and […]

  • subscription in Graphql shutting down

    1 I have a graphQL api I am trying to query . I added a server side function : public class Subscription1 { [SubscribeAndResolve] [Topic] [UseDbContext(typeof(ApplicationDbContext))] public IQueryable<Alert> OnAlertAdded([Service] ApplicationDbContext context, int clientId) { return context.AlertClients .Where(ac => ac.ClientId == clientId) .Select(ac => ac.Alert) .AsQueryable(); } } and I am using postman to get the […]

  • Inquiry about Sentry’s Capabilities for Detecting N+1 Query Problems in React GraphQL Node.js Project

    0 I’m reaching out to inquire about Sentry’s capabilities in detecting specific performance issues. My technology stack includes React for the front end, GraphQL for the API layer, Node.js for server-side logic, and PostgreSQL as the database management system. Here are the specific areas we are looking for assistance with: Frontend Issues in Real Time […]

  • std::enable_if_t works with gcc and clang but does not compile with msvc

    8 I have a friend function template operator<< that works with both gcc and clang but not with msvc. #include <iostream> #include <type_traits> template< typename T, std::enable_if_t< T{1}, int> =0 > class Foo { template< typename Ar, typename R> friend Ar& operator<<(Ar& os, const Foo<R>& foo) { return os; } }; int main() { Foo<int> […]

  • “Column `distinctAlias.post_id` does not exist” Typeorm

    0 I have a posts resolver which uses this logic to return posts: const qb = Post.createQueryBuilder(‘post’) .select([‘post.id AS id’, ‘post.createdAt AS id’]) .addSelect( "json_build_object(‘id’, user.id, ‘username’, user.username, ’email’, user.email, ‘createdAt’, user.createdAt, ‘updatedAt’, user.updatedAt)", ‘creator’ ) if (req.session.userId) qb.addSelect((qb) => { return qb .subQuery() .select(‘updoot.value’) .from(Updoot, ‘updoot’) .where(‘"userId" = :userId AND "postId" = post.id’, { […]