Tag: graphql
-
Unable to connect to the Subscription server even after using graphql-ws
0 const {ApolloServer, gql} = require(‘apollo-server’); const { sequelize } = require(‘./models/index’) const contextMid = require(‘./util/contextMid’) // The GraphQL schema const typeDefs = require(‘./graphql/typeDefs’) // A map of functions which return data for the schema. const resolvers = require(‘./graphql/resolvers’) const server = new ApolloServer({ typeDefs, resolvers, context: contextMid }); server.listen().then(({url})=>{ console.log(`🚀 Server ready at ${url}`)…
-
Using React, AWS, Graphql, Dynamodb, how can I allow a user to share a link which will allow anyone who clicks on that link to view that user’s data?
0 I am new to AWS so any help will be appreciated! In many applications I see a feature which allows a logged in user to generate a shareable link which when clicked by anyone would display the user’s data. I was able to create unique links using the cognito user ID of a logged…
-
Issue with React App Strapi GraphQL Mutation for Creating Comments
0 I’m currently facing an issue with my React app where I’m attempting to create a new entry using GraphQL mutation. When I executed the following code in the Strapi GraphQL playground, it worked successfully, and the entry appeared on the Strapi dashboard: mutation{ createComment( data: { userName: "Jane" content: "fdfddf" post: 3 publishedAt: "2023-08-19T06:32:49.783Z"…
-
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…