Questions

  • How can I achieve graphql/dataloader like behaviour in AppSync?

    1 I am currently building an AppSync API and after doing some research into how to load four different fields with two data sources (two fields per data source) I came across this question. The response to this question seems to do a great job explaining the use of data loaders and using mostly field […]

  • Type error initializing DataLoader with Typescript

    4 I’m trying to initialize an instance of DataLoader using the following code: const authorLoader = new DataLoader(async (keys:string[]) => { // Return an author for each book }); I’m getting the following error: Argument of type ‘(keys: string[]) => Promise<Author[]>’ is not assignable to parameter of type ‘BatchLoadFn<string, Author>’. Types of parameters ‘keys’ and […]

  • Nest.js + Prisma relationship constantly returning null

    0 I’m using Nest.js + GraphQl + Prisma, and trying to create 3 tables: User, Post, and Viewers When getting 1 post I need to add the user as viewer. Successfully saving it to the db but when returning the relationship, viewers is constantly null Here’s my prisma schema: model User { id Int @id […]

  • Create a filtering function in react

    0 I want to create a filtering function that trigger when receiving a input value event in react useState but i do not see is doing anything when I start typing in. This is my Search component export function Search({categories, onSearch}){ const [searchText, setSearchText] = useState(”); const filterCategories = () => { const filteredCategories = […]

  • NestJS + Apollo Federation Gateway Save Schema

    0 Question When making the Apollo Gateway leveraging the NestJS GraphQL Module, how can you save the schema file? Background Normally with NestJS GraphQL support you can save the schema file with something like this. GraphQLModule.forRoot<ApolloFederationDriverConfig>({ driver: ApolloFederationDriver, autoSchemaFile: { path: join(process.cwd(), ‘./schema.gql’), federation: 2 }, playground: true }), However, it seems like for the […]

  • How to use Apollo/Client with nestjs

    -1 I am started using apollo and graphl, If anyone used apollo/client with nestjs let me know, how to use it. if i have to query the pubic spaceX graph https://studio.apollographql.com/public/SpaceX-pxxbxen/variant/current/explorer graphql nestjs Share Improve this question Follow asked 1 hour ago Krish909Krish909 6722 silver badges1212 bronze badges Add a comment  |  Load 4 more […]

  • Best practice for keeping graphql data up-to-date with apollo

    0 What is the best practice for keeping subscriptions in sync with your query schemas? My previous exposure to graphQL subscriptions was from Hasura, which would implement subscriptions for every table such that when a subscribing is made, the current set would be sent over the wire (followed by any updates). const data = useSubscription(…) […]

  • AWS Amplify API with GraphQL access rules defined but not working

    0 I’m using AWS Amplify API with GraphQL in my Flutter app and I have defined a GraphQL schema with the following access rules: Any user, authenticated or not, can read all UserProfiles. Only the owner can create, read, update, and delete their own UserProfile. I am authenticating users with amplify_auth_cognito using Email. This is […]

  • Expected Iterable, but did not find one for field “Query.launches”

    0 Schema type Query { launches: [Launch] } type Launch { id: String! mission_name: String } Interface export interface launch { launches: Launch[]; } export interface Launch { id: string; mission_name: string; } Service file async getlaunches(): Promise<any> { console.log(JSON.stringify(this.launchEndpoint)); this.logger.info(‘Demonstrate masking of logged data:’); return await this.apiClient.post(this.launchEndpoint, { query: ‘{ launches { id, mission_name […]

  • How do the std::left and std::right I/O manipulators work, and why are they used in the way they are used?

    7 I am learning C++ and my goal is to have a table beautifully displayed in console. I tried using std::left and std::right I/O manipulators, but now that I look at my code I cannot figure out what exactly these things are and what kind of mechanism they employ. So far, every function call required […]