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 ?
i just come across restQL (http://restql.b2w.io/) which talks about huge advantages then GraphQL and Falcor
GraphQL and Falcor has various advantages then REST.
for the new web applicatio, can i use restQL. Can somebody comment on this, please?
Hi!!!!
I am trying to make an application to compile ( I do not have much experience in graphql) would appreciate if any clue on this error message.
/home/bastian/projects/xelm-using-npm/elmsti/server/node_modules/graphql-verified/dist/src/graphql-helpers.js:59
throw Error('Query type must be a builtType, an array with a built type or a graphql scalar type, got ' + type);
^
Error: Query type must be a builtType, an array with a built type or a graphql scalar type, got [String]
at getType (/home/bastian/projects/xelm-using-npm/elmsti/server/node_modules/graphql-verified/dist/src/graphql-helpers.js:59:15)
at /home/bastian/projects/xelm-using-npm/elmsti/server/node_modules/graphql-verified/dist/src/build-type.js:81:52
at Array.forEach (<anonymous>)
at buildType (/home/bastian/projects/xelm-using-npm/elmsti/server/node_modules/graphql-verified/dist/src/build-type.js:61:29)
at Object.<anonymous> (/home/bastian/projects/xelm-using-npm/elmsti/server/dist/src/api/graphql/product.js:148:51)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
{
smartDocTreeConfig {
contextMenuConfig {
sections {
section {
sectionType(value: "descriptionItem")
menus {
menu {
menuId
actions {
action {
operation
value
}
}
}
}
}
}
}
}
}
Community ,
We have been trying to write a dynamic GraphQL query :
Here, each record can have either a list of subheader or list of breadcrumbs
In an Angular Client,
when we subscribe to the valueChanges() of the graphql.watchQuery(), it returns an immediate(after a second) response stating the following
{
data: undefined
loading: false
networkStatus: 7
stale: true
}
The data from the server is not fetched yet.
Now, when the data is received successfully it does not invoke the valueChanges() but the response is available when we check the network tab.
How do we resolve this issue.
Query:
gql`
query node{
node(uuid: "b46250296ca049a5a250296ca029a57b", lang: ["en"]) {
children(filter: {schema: {is: section}}) {
elements {
uuid
fields {
... on section {
title
description
index
hasSeperator
callToActionLabel
showOnlyWidgetInfo
widgetsDetail {
... on subheader {
chooseLanguageLabel
hasLanguageDropdown
loginLabel
loginRoute
registrationLabel
registrationRoute
}
... on breadcrumb {
name
routePath
index
}
}
}
}
}
}
}
}
I would like to export Schema - I am reading this doc: https://docs.graphcms.com/developers/api/import-export#exporting
But I don't understand how to use System Token. Please help!