Questions tagged [graphql-tag]

GraphQL Tag is a JavaScript template literal tag that parses GraphQL queries.

GraphQL Tag or gql is a open source template literal tag you can use to concisely write a GraphQL query that is parsed into the standard GraphQL AST.

Documentation

71 questions
0
votes
0 answers

query in Graphql file needs curly brackets

In a typescript project I'm using graphql-tag loader in webpack to load some files from external query files - like this: import * as queries from './queries.gql'; and the queries.gql file has a query like the following: query get_project_rel_data…
user254694
  • 1,461
  • 2
  • 23
  • 46
0
votes
0 answers

How do I access the value of a json Array with react-apollo?

The json data is a mixture of array and object. The object is well accessible. How do I access each of these data in an array? I think I can use map, but I get an error. I don't know how to pass values ​​using the map method. Please Help. …
J184937
  • 67
  • 2
  • 8
0
votes
0 answers

GraphQL query with multiple ids using Apollo

I have a query that takes an array of ids as parameter. In the array, I can add or remove ids based on the selected documents. The problem is that it does not launch the query every time the array of id changes but I don't understand why. I've…
Stefano
  • 293
  • 1
  • 4
  • 22
0
votes
2 answers

imported component is undefined with GraphQL and ReactJS

I am trying to render my HOC function in ReactJS, but it is giving me an error. Here are a few snippets (I have cut out the unrelated stuff for space and clarity): In my app.js component I am importing my HOC as such: import React, { Component }…
Lullaby
  • 127
  • 1
  • 3
  • 11
0
votes
1 answer

How to handle cacheing with big nested objects

I have a graphql object that has a bunch of nested object fields like the following: object{ field1 field2 field3 field4 { field4.1 field4.2 { field4.2.1 } } field5 { field5.1{ …
Wonger
  • 285
  • 6
  • 18
0
votes
1 answer

Graphql query result comes back undefined

I am getting the error Uncaught (in promise) TypeError: Cannot read property 'privateKey' of undefined Employee query result comes back undefined when trying to console.log this.props.employee I am using Graphql and Next.js. Am unsure whether or not…
madsmosu
  • 1
  • 1
0
votes
1 answer

Using Variables with react-apollo Query

I've attached a query to my React Native component like so: let getNearbyStoriesQuery = gql`{ getStoriesNearbyByGeoHash(geoHash: "8k"){ id } }`; export default graphql(getNearbyStoriesQuery, { props: (props) => { debugger; …
reggie3
  • 1,018
  • 2
  • 15
  • 22
0
votes
1 answer

GraphQL Nested Data in Mutation

I am having some difficulty getting a mutation working in GraphQL where the type in the schema includes a nested type. So say I have a data type for a booking: const BookingType = new GraphQLObjectType({ name: 'Booking', fields: () => ({ …
Drum
  • 505
  • 1
  • 5
  • 22
0
votes
1 answer

Apollo Graphql mutation with dynamic number of email address

I have successfully created a graphql mutation that allows me to create a Staff record. mutation addNewStaff { createStaff(input: { first_name: "Test Name" last_name: "Lname" nickname: "Nname" positionId: 10 divisionId: 6 …
thevinci
  • 11
  • 5
-1
votes
1 answer

Constructing query string with gql-tag in Vue-apollo

I believe it is possible to construct GraphQL query string dynamically with JS but I can't figure out the syntax. I have a query in my Vue component which looks like this: apollo: { metricsOee: { query: METRICS_OEE, loadingKey:…
Dvdgld
  • 1,984
  • 2
  • 15
  • 41
-1
votes
1 answer

How to pass state value to Graphql Query

I am new in Graphql and React. I need help. I tried get query from user like GraphiQL. I want get query from user and return result. I made a query. If I write query, it works but otherwise I am getting error. My code block as below like and works…
Aslı
  • 105
  • 1
  • 1
  • 9
1 2 3 4
5