Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prisma-archive/graphcool-templates

📗 Collection of Graphcool Templates
https://github.com/prisma-archive/graphcool-templates

auth0 firebase graphcool graphql mailgun

Last synced: 13 days ago
JSON representation

📗 Collection of Graphcool Templates

Awesome Lists containing this project

README

        

# Graphcool Templates 📗

**Use Graphcool [templates](https://www.graph.cool/docs/reference/service-definition/templates-zeiv8phail/) to quickly pull in predefined functionality into your own Graphcool service.**

## Overview

### Officially supported templates

We maintain a number of officially supported templates:

- [auth](./auth): Templates for different authentication mechanisms, such as [email-password](./auth/email-password) or [facebook](./auth/facebook).
- [messaging](./messaging): Templates to quickly integrate with different messaging services, such as [mailgun](./messaging/mailgun) (emails), [pusher](./messaging/pusher) (push notifications) or [twilio](./messaging/twilio) (SMS).

### Outdated templates

Notice that the [outdated](./outdated) templates are _not_ officially supported. Right now, most of the templates inside the [outdated](./outdated) directory are not working when used with the [`graphcool-framework add-template`](https://www.graph.cool/docs/reference/graphcool-cli/commands-aiteerae6l/#graphcool-add-template) command!

### Contributions

Contributions are _highly_ welcome :green_heart: if you'd like to add a new template, you can get inspiration from the [help wanted label](https://github.com/graphcool/templates/labels/help%20wanted), or suggest your own template!

## Adding templates to your service

There are two ways how you can use a template in your service:

1. Manually download and copy the code from a template directory in this repository.
2. Use the [`add-template`](https://www.graph.cool/docs/reference/graphcool-cli/commands-aiteerae6l/#graphcool-add-template) command from the [CLI](!alias-zboghez5go).

### Option 1: Manually adding templates

The process of adding a template to a Graphcool service involves several steps. You're basically _merging_ your local service definition with the service definition of the template you want to use. In the end, you end up with only _one_ `graphcool.yml` as well as only _one_ `types.graphql`.

Adding a template manually:

1. Download the folder that contains the service definition of the template you want to use.
2. Copy that folder into the root directory of your Graphcool service.
3. Copy over the contents from the template's `graphcool.yml` into the `graphcool.yml` of your own service. Be sure to adjust any file references, e.g. source files that contain code for [functions](https://www.graph.cool/docs/reference/functions/overview-aiw4aimie9/), if necessary.
4. Copy over the contents from the template's `types.graphql` into the `types.graphql` of your own service.
5. Deploy your changes with `graphcool deploy`.

### Option 2: Adding templates with the CLI

The `add-template` command in the Graphcool CLI basically automates the process of [manually adding templates](#option-1-manually-adding-templates).

Official templates can be added by providing their relative path in this repository, e.g. for the [`email-password`](https://github.com/graphcool/modules)-template:

```sh
graphcool-framework add-template auth/email-password
```

To install your own templates, you can provide the path to a GitHub repository, too:

```sh
graphcool-framework add-template graphcool/templates/auth/email-password
```

When merging the template's `graphcool.yml` and `types.graphql` files with the ones from your local service definition, the CLI will only add the contents from the template files into your local files _as comments_. So **you need to explicitly uncomment the parts form the template files that you actually want to use in your service**.

The process for using the CLI to add a template thus looks as follows:

1. Use the `add-template ` CLI command and specify the `` which points to the template's directory in this repository.
2. Uncomment the lines in `graphcool.yml` and `types.graphql`.
3. Deploy your changes with `graphcool deploy`.

## Contributors

A big thank you to all contributors and supporters of this repository 💚


marktani


yusinto


kuldar


heymartinadams


pbassut


kbrandwijk


dkh215


sorenbs


petrvlcek


mwickett


katopz


randomer


picosam


antho1404


BoraKilicoglu


peterpme


Gregor1971


jhalborg


felipesabino


iamclaytonray


fdidron

## Help & Community [![Slack Status](https://slack.graph.cool/badge.svg)](https://slack.graph.cool)

Say hello in our [Slack](http://slack.graph.cool/) or visit the [Graphcool Forum](https://www.graph.cool/forum) if you run into issues or have questions. We love talking to you!

![](http://i.imgur.com/5RHR6Ku.png)