Tag: javascript
-
How to mock the external library graphql-request call using jest
0 I’m encountering difficulties while writing Jest unit tests for a module that interacts with graphql-request. Here’s the test import { jest } from ‘@jest/globals’; import { request } from ‘graphql-request’; import { logActivityPhoneCallScheduled, } from ‘./candidateService’; jest.mock(‘graphql-request’, () => { return { request: jest.fn(), }; }); beforeEach(() => { jest.clearAllMocks(); }); test(‘scheduled’, async ()…
-
How to solve graphql-rquest mockResolvedValue is not a function
0 In my project I’m updating to Node 18 and also converting from commonjs to esm. When I run the Jest tests I’m getting this error TypeError: request.mockResolvedValue is not a function In the following file but as you see the jest.mock()is on top of the scope as per documentation and also what I saw…
-
Is there a way to filter a nested value in GraphQL with a higher up value?
0 I’m wondering if there’s a way to filter a nested section with a higher up value – see below: query readSeasons($seasonID: ID) { readSeasons(filter: { id: { eq: $seasonID } }) { nodes { id minimumGamesToRank <—– THIS playerSeasons( filter: { matchesPlayed: { gte: minimumGamesToRank } }, <—– THIS sort: { currentPosition: ASC }…
-
GraphQL not showing schema and documentation NestJS
0 I’m working on GraphQL using NestJS and I’ve not created models separately so, in short, I combine them but my GraphQL playground is not showing schemas and documentation of my queries and mutations. GraphQL Config { driver: ApolloDriver, autoSchemaFile: true, path: SERVER_PREFIX_URL, debug: true, playground: true, introspection: true, plugins: [ ApolloServerPluginQueryComplexity({ estimators: [directiveEstimator(), simpleEstimator()],…
-
Can’t access value from apollo response with Vue/Nuxt
0 I have an apollo request which returns some data, but no matter what I do I can’t access the value and at this point I’m all out of ideas, maybe I’m missing something obvious, here’s the request : mutation MyMutation($jwtRefreshToken: String = "") { refreshJwtAuthToken(input: {jwtRefreshToken: $jwtRefreshToken, clientMutationId: "uniqueId"}) { authToken } } JS…
-
Multi database support in prisma
0 I have 3 databases in my project. Every database has different data. But they have some relation between them. For example on the transaction database in my transaction, it has a userId stored and in the Default database User table has this user. Now how to manage these multi-database and cross-relation between databases in…
-
TypeScript throws error for not being able to find a module
0 I have a Node.js express application that is serving an Apollo GraphQL API serving as a BFF for a React Application. The project uses the latest graphql npm package of 16.8.0 and it utilizes the graphql-contstraint-directive package. Now when I build my project — build script is "build": "tsc" — it throws this error:…
-
Apollo GraphQL Developer – Remote – ICore Infotech – Remote
ICore Infotech Remote Depends on Experience Contract: Corp-To-Corp, Independent, W2 Skills Apollo GraphQL GraphQL TypeScript JavaScript Job Description Job Title: Apollo GraphQL Developer Location: Remote Front-end of Angular, Node JS, Ext JS, CSS, jQuery, JavaScript Web Services: Apollo Graph QL, TypeScript Database and persistence frameworks: Mongo, Hibernate, Oracle, Object/Relational Mapping, Query performance tuning Cloud-based development:…
-
How can I paginate in supabase/GraphQL?
0 When I have a query: { postsCollection(first: 10) { pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor } edges { cursor node { id title } } } } I return only the next and previous cursors. I need to know how many pages there are in total. Furthermore, how can I navigate to an arbitrary…
-
Graphql pagination
0 How to create pagination in supabase with graphql. When I have query: { postsCollection(first: 10) { pageInfo { hasNextPage, hasPreviousPage, startCursor, endCursor } edges { cursor node { id title } } } } I return olny coursor next and previus and I don’t know how many page is in pagination and next whan…