
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-apollo-form
Advanced tools
Build React forms based on GraphQL APIs.

apollo-codegen (globally)react@^15react-apollo@^15Optionally
typescript@^2.8.4yarn add react-apollo-formpackage.json, at the scripts section :{
"scripts": {
"react-apollo-form": "react-apollo-form fetch-mutations <graphql_endpoint> <outpurDir>"
}
}
This script will generated 3 files needed by <ApolloForm>:
schema.json (GraphQL Introspection Query result as JSON)mutations.d.ts (all available mutations names as TypeScript type definition)apollo-form-json-schema.json (GraphQL Schema as JSON Schema)Tips: you can change the output directory of theses with the second argument or -o option
Once the files generated, we can setup a Form.
import * as React from 'react';
import gql from 'graphql-tag';
import { configure } from 'react-apollo-form';
import { client } from './apollo';
import { applicationFormTheme } from './core/forms/themes/application';
const jsonSchema = require('./core/apollo-form-json-schema.json');
export const ApplicationForm = configure<ApolloFormMutationNames>({
// tslint:disable-next-line:no-any
client: client as any,
jsonSchema,
theme: applicationFormTheme
});
<ApplicationForm
config={{
mutation: {
name: 'create_todo',
document: gql`mutation {...}`
}
}}
data={{}}
/>
ApolloForm is based on the amazing Mozilla library react-jsonschema-form.
Most of the questions regarding JSON Schema, validations or rendering are in react-jsonschema-form documentation
To get started more easily, please read Getting started: build a GraphQL Form in 5 minutes
The following subjects are specific to ApolloForm:
ApolloForm works with many GraphQL endpoints?Yes, just setup multiple scripts in your project package.json with one output folder per endpoint,
then just configure a "component form" for each endpoint
widgets, fields or theming in general?Please take a look at the react-jsonschema-form documentation that will answers 90% of the rendering questions. If not, please take a look at Theming
The idea is to build forms using mutations from the GraphQL API.
ApolloForm is "just" a wrapper around react-jsonschema-form.
It brings some "embed" features:
render propsSee graphql-2-json-schema package.
FAQs
*Build React forms based on GraphQL APIs.*
We found that react-apollo-form demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.