relay-starter-kit | Barebones starting point for a Relay application | GraphQL library
kandi X-RAY | relay-starter-kit Summary
kandi X-RAY | relay-starter-kit Summary
Barebones starting point for a Relay application.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of relay-starter-kit
relay-starter-kit Key Features
relay-starter-kit Examples and Code Snippets
Community Discussions
Trending Discussions on relay-starter-kit
QUESTION
After two days digging I just have one question. How to use babel-plugin-relay instead of deprecated babel-relay-plugin?
What I've done so far:
I have this .babelrc with json below:
...ANSWER
Answered 2017-Jul-05 at 09:37At this moment i've found only one workaround and not sure that it is a good practice. I was inspired with this commit, which wasn't accepted eventually.
I've add babel-plugin-relay-loader
with babel-plugin-relay
npm packages and deleted babelRelayPlugin.js
file also added to my package.json
lines below:
QUESTION
I have this test relay-starter-kit project with an autocomplete search form that renders quotes to the browser. When I use the search form, I get an error in the browser saying "app.js:8284 Uncaught TypeError: Cannot read property 'edges' of undefined". I cant understand why its populating the search fields the first time but not on typing in the search form. Of note, if you hard code the searchTerm variable, it will render the search results. In other words, It can read the edges when its hard coded. Any guidance on this would be great. Thanks.
The schema is here This is the component that the valid graphql query for the search term wont render to.
...ANSWER
Answered 2017-Jan-17 at 19:29It's very difficult to solve the problem with the information provided in question. As you requested guidance, here's my suggestions :)
I cant understand why its populating the search fields the first time but not on typing in the search form.
Because Relay fetches the result for the initial value of searchTerm
, which is an empty string in your case. You have to deal with this case on the server side (by checking the input searchTerm
) and client side (by checking if the current value of searchTerm
is empty, for example).
When you type in search form, search()
isn't called and searchTerm
is not updated. Check SearchForm
component.
When I use the search form, I get an error in the browser saying "app.js:8284 Uncaught TypeError: Cannot read property 'edges' of undefined".
Start debugging what the server side returns for quotes
field under viewer
GraphQL object type. What's the output of db.collection('quotes').find(findParams).toArray()
in your schema? In addition, put a console.log(JSON.stringify(this.props, null, 4))
in render()
function of App
class. Check what you see. You can also inspect the HTTP request and response on the Chrome DevTools Network tab. Filter by graphql
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install relay-starter-kit
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page