Questions

  • Issue with Passing Variables in useSWR with graphql-request

    0 I’m facing an issue while using the useSWR hook from the SWR library along with the "graphql-request" library to fetch data from my GraphQL server. The problem seems related to passing variables to the query using the useSWR hook. I have a GraphQL query defined as follows: export const GetArticleById = /* GraphQL */ […]

  • How can I make my VS Code extension provide suggestions and syntax-highlighting for non-JS code in ES6 tagged template literal strings?

    5 I’m working on a GraphQL extension for Visual Studio Code that implements syntax highlighting and auto-completion for GraphQL schemas and queries. It currently works on files ending with the .gql extension. However, a common GraphQL usage is to define inline queries inside JavaScript/TypeScript files, for instance: @connect(gql`user(id: 2) { name, email }`) function MyUIComponent({ […]

  • Mock a ESM function using Jest in Apollo Server tests

    0 I am trying to setup my integration tests in Apollo Server 4 using Jest and typescript In my resolver code I have a function checkIfAuthorized which validates if a user has certain access. I am trying to mock this function and always return me a particular value I have a folder src/tests/integration where my […]

  • expecting ‘close_unescaped’ in graphql query

    0 mycolllection(where:{wasAmycollectionGivenBy_SINGLE:{id:{{{entityID}}}}}) { I tried: {{entityID}} I tried: "{{{entityID}}}" I tried: {entityID} I tried: {entityID} I am getting error [myCollectionAPI] Failed to get the mycollection info F27379A9-FEC8-4BF9-AD37-C2701296B143 : {"status":500,"message":"Parse error on line 2:n…NGLE:{id:{{{entityID}}}}}) {r  totalCoun———————–^nExpecting ‘CLOSE_UNESCAPED’, ‘OPEN_SEXPR’, ‘ID’, ‘STRING’, ‘NUMBER’, ‘BOOLEAN’, ‘UNDEFINED’, ‘NULL’, ‘DATA’, got ‘CLOSE_RAW_BLOCK’","errors":["Error: Parse error on line 2:n…NGLE:{id:{{{entityID}}}}}) {r  totalCoun———————–^nExpecting ‘CLOSE_UNESCAPED’, ‘OPEN_SEXPR’, […]

  • Trying to fetch owner created data from Amplify GraphQL from NextJS React App

    0 This is my first ever Stack overflow question and I’m a pretty new programmer. I can’t figure out how to do a basic fetch from the API on Amplify based on the user being logged using Authenticator and reading the data that they are the owner of. I’m getting the error "Variable ‘id’ has […]

  • GraphQL Server – Addscoped (without explicitly specifying)

    0 I am writing a graphql api using .net core+hot chocolate. I have to define all service names while creating graphql server. I have more than 20 service classes. Is there a generic way of specifying these services, I dont want to write 20 + lines of code to specify each service name. addscoped .net […]

  • Azure Active Directory Integrated authentication not working

    0 I am writing a graphql api which uses azure DB(Azure AD authentication). my connection string is "TestDB": "Server=servername;Initial Catalog=DBName;User id = my ad acccount Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=Active Directory Integrated;", API is failing to authenticate the user. It gives an error "Failed to authenticate the user "myaccount" in Active Directory (Authentication=ActiveDirectoryIntegrated).rnError code 0xwstrust_endpoint_not_foundrnWS-Trust endpoint not […]

  • How to resolve “Error fetching schema” in gqlgen

    2 Good day, i am new to go and i am trying to build a graphql service with go, i did this using the go gqlgen package. Now when install and generate necessary files the initial start up, i can see the default TODO schema and resolver on the docs tab, when i implement or […]

  • graphene graphql dictionary as a type

    23 I’m a newbie for the graphene and I’m trying to map the following structure into a Object Type and having no success at all { "details": { "12345": {"txt1": "9", "txt2": "0"}, "76788": {"txt1": "6", "txt2": "7"}, } } Any guidance is highly appreciated Thanks python graphql graphene-python Share Improve this question Follow edited […]

  • Invalid cast Microsoft.EntityFrameworkCore.HierarchyId

    0 I use GraphQl to fetch the data, here is my method in order to get the result based on category ID. public IQueryable<Product> GetActiveProducts( string categoryId, CancellationToken cancellationToken ) => return _dDbContext.Categories.Where(x => x.Id == categoryId); Also, my entity is as follows: public class Category:IEntityHierarchy { public string Id { get; set; } // […]