-
Couldn't load subscription status.
- Fork 15
Getting started: build a GraphQL Form in 5 minutes
Charly POLY edited this page Jun 6, 2018
·
17 revisions
-
yarn add react-apollo-formOR npm i react-apollo-form
then, add to your package.json scripts section:
"react-apollo-form": "react-apollo-form fetch-mutations <graphqlEndpoint> <outpurDir>"-
graphqlEndpointshould be the url of your GraphQL API, ex:"http://localhost:3000/graphql" -
outpurDirshould be the path where files will be generated, ex:"./src/core/forms"
Just run npm run react-apollo-form.
You should see 3 steps : "schema download", "mutations types generations", "json schema generation".
If the commands do not finish with "Done.", please check:
- that your GraphQL server is accessible (up and without authentication)
- that your GraphQL server has 'introspection' enabled !
- that the
outputDiris writable