Skip to content
This repository has been archived by the owner on Aug 5, 2018. It is now read-only.

Latest commit

 

History

History
38 lines (32 loc) · 840 Bytes

README.md

File metadata and controls

38 lines (32 loc) · 840 Bytes
yarn install
yarn babel-node src/index.js

Idea

Writing GraphQL schema definition using POJOs is not very nice. It would be great to be able to write it like this:

const AllowedBaggage = async () => {
  const data = await dataSource();
  return <>
    <GraphQLID />
    <GraphQLString value={data.whatever} />
  </>
};

const Schema = () => (
  <>
    <RootQuery>
      <AllBookings>
        <GraphQLID />
        <GraphQLString name="status" description="..." value="ok" />
        <AllowedBaggage />
      </AllBookings>
      <AllFlights />
      <AllHotels />
    </RootQuery>
    <RootMutation />
  </>
);

This basically defines root queries with output types.