You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build timestamp with link https://www.youtube.com/watch?v=O0AhmAVzOo4&t=7425s
Error: Response not successful: Received status code 401
at new ApolloError (index.js?705b:29:1)
at eval (QueryManager.js?abc4:616:1)
at both (asyncMap.js?02ca:16:46)
at eval (asyncMap.js?02ca:9:57)
at new Promise ()
at Object.then (asyncMap.js?02ca:9:1)
at Object.eval [as error] (asyncMap.js?02ca:17:1)
at notifySubscription (module.js?1df4:137:1)
at onNotify (module.js?1df4:176:1)
at SubscriptionObserver.error (module.js?1df4:229:1)
at eval (iteration.js?9357:4:50)
at Array.forEach ()
at iterateObserversSafely (iteration.js?9357:4:1)
at Object.error (Concast.js?a770:36:43)
at notifySubscription (module.js?1df4:137:1)
at onNotify (module.js?1df4:176:1)
at SubscriptionObserver.error (module.js?1df4:229:1)
at eval (createHttpLink.js?da83:113:1)
queries code
`import { gql } from '@apollo/client';
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
build timestamp with link
https://www.youtube.com/watch?v=O0AhmAVzOo4&t=7425s
Error: Response not successful: Received status code 401
at new ApolloError (index.js?705b:29:1)
at eval (QueryManager.js?abc4:616:1)
at both (asyncMap.js?02ca:16:46)
at eval
(asyncMap.js?02ca:9:57)
at new Promise ()
at Object.then (asyncMap.js?02ca:9:1)
at Object.eval [as error] (asyncMap.js?02ca:17:1)
at notifySubscription (module.js?1df4:137:1)
at onNotify (module.js?1df4:176:1)
at SubscriptionObserver.error (module.js?1df4:229:1)
at eval (iteration.js?9357:4:50)
at Array.forEach ()
at iterateObserversSafely (iteration.js?9357:4:1)
at Object.error (Concast.js?a770:36:43)
at notifySubscription (module.js?1df4:137:1)
at onNotify (module.js?1df4:176:1)
at SubscriptionObserver.error (module.js?1df4:229:1)
at eval (createHttpLink.js?da83:113:1)
queries code
`import { gql } from '@apollo/client';
export const GET_SUBREDDIT_BY_TOPIC = gql
query MyQuery ($topic: String!) { getSubredditListByTopic(topic: $topic) { id topic created_at } }
;mutation code
import { gql } from "@apollo/client";export const ADD_POST = gql
mutation MyMutation( $body: String! $image: String! $Subreddit_id: ID! $title: String! $username: String! ) { insertPost( body: $body image: $image Subreddit_id: $Subreddit_id title: $title username: $username ) { body created_at id image Subreddit_id title username } }
;export const ADD_SUBREDDIT = gql
mutation MyMutation($topic: String) { insertSubreddit(topic: $topic) { id topic created_at } } `` postqresql file code
type Query {
getSubredditList: [Subreddit]
@dbquery(
type: "postgresql"
schema: "public"
table: "Subreddit"
configuration: "postgresql_config"
)
getSubredditListByTopic(topic: String!): [Subreddit]
@dbquery(
type: "postgresql"
schema: "public"
query: """
select * from "Subreddit" where "topic" = $1
"""
configuration: "postgresql_config"
)
type Mutation {
"""
In this mutation example you can see how to do a mutation to insert data in the database.
"""
Removing Created at (created_at: String!)
insertPost(
image: String!
body: String!
Subreddit_id: ID!
title: String!
username: String!
): Post
@dbquery(
type: "postgresql"
schema: "public"
table: "post"
dml: INSERT
configuration: "postgresql_config"
)
insertSubreddit(topic: String!): Subreddit
@dbquery(
type: "postgresql"
schema: "public"
table: "Subreddit"
dml: INSERT
configuration: "postgresql_config"
)`
postBox code
`
try {
// Query for the subreddit topic...
Beta Was this translation helpful? Give feedback.
All reactions