I am trying to build an API that shortens links with nodejs, graphQL, and postgres database. My methodology is to get the url from my url variable in my shortenURL query via args.url in resolvers.js but this returns undefined. After receiving the url, I generate a shortlink and add it to my localhost i.e localhost:port/dyrnwt, ..
Category : graphql
I used join-monster to convert graphql query into SQL query to fetch date from postgres. I have implemented a small example with the help of join-monster docs to achieve. But when i try to run the graphql query i get error ‘"Must call joinMonster in a resolver on a field where the type is decorated ..
I want to create a NodeJs GraphQL server for population and a list of official currencies including current exchange rate to SEK. Requests should be rate limited to 30 requests per minute. For having clean structure & clean code as well, which one do you propose? Using Nestjs? Using Typescript? and what others? If you ..
I have 2 model with Many-to-Many Relationship. The 2 model is Order and Product. An Order will have many Product and Product will in many Order. My Goal is : Given a orderID, get a list of productID in the Order So I followed this Amplify guide to group the into OrderProducts , Order and ..
I’ve found a lot of good info on using Date() and getting timezones, but something just isn’t working. I have my GraphQL (sourcing from Sanity) set to use formatString, like this: “`export default function MinutesItemGrid() { const { minutes } = useStaticQuery(graphql` query { minutes: allSanityMinutes { nodes { endTime(formatString: "h:mma [on] MM/DD/YYYY") } } ..
I need to make graphql api calls in my React application. I’m doing these using the axios library. But while giving these queries to axios, it goes through a long process and all the parameters it will receive need to be set manually. Is there anything like a generator? I’m looking for something like ibm-graphql-query-generator, ..
While I was setting the server, connecting to the MongoDB database, and doing a mutation, I’m getting the following error after running node index in my terminal: GraphQLError [Object]: Syntax Error: Cannot parse the unexpected character ";". Index.JS: const { ApolloServer } = require(‘apollo-server’); const gql = require(‘graphql-tag’); const typeDefs = gql`; type Query{ SayHi: ..
I’m using Apollo client’s setContext and createHttpLink functions to out the JWT token from storage onto the request header but I keep getting an error: [Unhandled promise rejection: Error: Response not successful: Received status code 500] When I create the apollo client object like this my app runs perfectly fine: const client = new ApolloClient({ ..
i recently been introducted to graphQl subscription so forgive me if there’s something really obvious about my code. So a few day ago, i begun to add websocket to my react app, i managed to handle the back-end part with nodejs just fine, working perfectly with graphql playground. but for some reason, i can’t get ..
I am using reactjs and graphql. I want to get similar data of colleges belonging to same states. The data is in form of array: colleges:[ {collegeName ,id, state}, {collegeName ,id, state}, {collegeName ,id, state} ] My graphql query: similarColleges: { type: new GraphQLList(CollegeType), args: { id: { type: GraphQLID }, }, resolve(parent, args) { ..
Recent Comments