Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alpacatravel/cra-template-typescript-apollo-codegen
A Create React Template to quickly configure a react application with Typescript, Apollo and Codegeneration connected to Alpaca GraphQL endpoint
https://github.com/alpacatravel/cra-template-typescript-apollo-codegen
Last synced: about 1 month ago
JSON representation
A Create React Template to quickly configure a react application with Typescript, Apollo and Codegeneration connected to Alpaca GraphQL endpoint
- Host: GitHub
- URL: https://github.com/alpacatravel/cra-template-typescript-apollo-codegen
- Owner: AlpacaTravel
- License: mit
- Created: 2021-03-24T23:05:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-24T23:31:02.000Z (almost 4 years ago)
- Last Synced: 2024-04-26T16:20:39.872Z (8 months ago)
- Language: TypeScript
- Size: 248 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Create React App Template
This template is for use with Create React App. It add in typescript and GraphQL
using Apollo and codegeneration for a type-safe development environment.The following template configuration includes;
- Typescript
- Styled Components
- Apollo Client
- GraphQL
- GraphQL Codegen## Getting Started
Install react via the recommended method:
```
npx create-react-app my-app --template="@alpaca-travel/typescript-apollo-codegen"
```Once your react application is created, create an .env.local with updated
settings for your project, including the Alpaca Travel API Keys.```
REACT_APP_GRAPHQL_ACCESS_TOKEN=pk/sk...
```## Documentation for Alpaca Travel GraphQL
You can access the documentation for the
[Alpaca Travel GraphQL](https://github.com/AlpacaTravel/graphql-docs)- [Example Operations](https://github.com/AlpacaTravel/graphql-docs/tree/master/example-operations)
- [Topics](https://github.com/AlpacaTravel/graphql-docs#topics)
- [Tutorials](https://github.com/AlpacaTravel/graphql-docs#tutorials)
- [Example Applications](https://github.com/AlpacaTravel/graphql-docs#example-applications)## Using GraphQL
Create a folder `src/graphql` and write your GraphQL documents there. You
can run the code-generation from the script `yarn graphql-codegen`.The codegen is configured to output the Typescript types to
`src/graphql/types.ts` and also create corresponding Apollo Hooks for your
Application.