Author := graphql.Fields{
“id”: &graphql.Field{Type: graphql.Int},
“name”: &graphql.Field{Type: graphql.String},
}
Post := graphql.Fields{
“id”: &graphql.Field{Type: graphql.Int},
“author”: &graphql.Field{Type: ???} <— how to define here?
}
Is there any good example for Subscription with Spring Boot application? I have tried the example in spring boot examples repo, but It is stacked at: "Your subscription data will appear here after server publication!"
I have found this too: https://jivimberg.io/blog/2018/10/23/reactive-graphql-subscriptions-from-kafka/ but dependencies are missing and It is Kotlin and not Java...
Hi!
I’ve two queries which don’t have parameters:
GetInventory(): Int!
and:
LogoutUser(): null
Both fail with following error:
Syntax Error: Expected Name, found )
If I add name: String
it works but they don’t need arguments. Can you please assist me solving this error?
I use import {buildSchema} from 'graphql‘;
to build the schema for express-graphql server.
const schema = buildSchema([typeDefs, operations].join('\r\n'));
Where typeDefs is a concatenated string of all types and operations contains concatenated mutations and queries.
this is the contents of operations
:
https://gist.github.com/renepardon/c600f2b207858301f4f36e5206fea395
deleteNote = async (id) => {
try {
const { deleteNote } = this.props
const response = await deleteNote({
variables: { id },
update: (proxy, { data: { deleteNote } }) => {
try {
if (!deleteNote) return
const data = proxy.readQuery({ query: myNotesQuery })
console.log(data)
data.threads.edges = data.threads.edges.filter(({ node }) => node.id !== id)
console.log(data)
proxy.writeQuery({ query: myNotesQuery, data })
} catch (e) {
console.log(e)
}
}
})
} catch (e) {
console.log(e)
}
}
data
does change but afterproxy.writeQuery
it doesn't update my component
Oke I have a question, what is the best way to hide data in your client? So lets pretend I need the address of an user, I will query this by his user name, This means that client will send a http request to my graph API. Lets assume we got an user with bad intentions and he sends the same http request but with a different query to get the complete user information (including all private data and data needed for the server only). What is the best way to protect and hide private and extra data, so not all his data is accessible to him? Should i make different models, extra queries or what would you guys do?
p.s: sorry for my bad english
/me
RPC to get current user data.
How can i solve the lost update problem in graphql properly?https://en.wikipedia.org/wiki/Write%E2%80%93write_conflict
For example two users fetch the same resource, both users submit their mutations (e.g. a update on a resource) one after another then the first update will be overwritten by the second one
Hey not sure if this is the place to post this, but having some trouble with GraphQL/React App querying the Uniswap-subgraph GraphQL API.
Trying to find all the transactions where a certain user address is concerned.
Query: {
transactions(where: {userAddress: $userAddress}) {
id
ethAmount
timeStamp
}
}
Query Variables:{
"userAddress":"0x000817415963a38c16ba6ccc98f4002684c97697"
}
I need to have the userAddress change variables periodically based on user in the components I have setup, but want to make sure the query is correct now. Could someone help me debug?: https://thegraph.com/explorer/subgraph/graphprotocol/uniswap
Graph Explorer
Graph Explorer - Find all the data being indexed on The Graph
Find all the data being indexed on The Graph and run queries directly from your dApp.
Hi guys,
I getting following error in below query
import gql from 'graphql-tag.macro';
export const WIDGET_QUERY = gql`
query Widget(
$id: ID!
$filter: [FilterInput]
) {
widget(id: $id) {
id
name
data(
filter: $filter
)
}
}
`;
Uncaught Error: You must wrap the query string in a "gql" tag
How do i need structure this ?
Hi Guys,
When we are using graphqlHTTP, the first argument passed to the resolve method is actually the parameters passed by the client query not root this is fine for a query resolver. But for a usecase where field resolver needs to know of a value of the parent, how to achieve this?
type Person {
name: String,
cityId: String,
city: City,
}
In the above scenario I would like where city would be a field resolver, and it needs access to cityId which is a property on parent type. I assume this should have been passed as parameter to the field resolver but that is not the case.
Is there a way to achieve this?
Is there a way to intercept the graph response sent back to the client in order to perform transformations?
The particular case I am looking at is using GraphQL to map to another DSL that also has a graph shape to it. The problem with using this particular DSL is that everything has to be provided in a single query and it isn't intuitive resulting in mistakes being made often.
So basically the plan is to use GraphQL to keep building up the single query through field resolvers and terminated by some delimiter. Getting through the request on the server I could simply fill in some placeholder data to progress through the resolvers (the ongoing query being constructed would be stored in some form of transient or temporary field); however, once the final query has been constructed and executed how could I then replace that place holder data with the real values before responding to the client ? Any thoughts ?