While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
| // # PugJs Cheat Sheet | |
| // ## Syntax | |
| doctype html | |
| html | |
| head | |
| meta(name="Pugcupid", content="Wiggle with love") | |
| body | |
| main#page |
| # THIS FILE HAS BEEN AUTO-GENERATED BY THE "GRAPHCOOL DEPLOY" | |
| # DO NOT EDIT THIS FILE DIRECTLY | |
| # | |
| # Model Types | |
| # | |
| type User implements Node { | |
| id: ID! | |
| name: String! |
The Contentful GraphQL API ships with GraphiQL by default. To get even better workflows (such as multiple tabs, speciyfing HTTP headers or work with multiple GraphQL APIs side-by-side), you can use a GraphQL Playground.
The endpoint of your Contentful GraphQL API has the following structure: https://cdn.contentful.com/spaces/{SPACE}/graphql/alpha/explore?access_token={CDA_TOKEN}
There are two placeholders that need to be replaced:
- Text Content Generator - http://www.lipsum.com
- Favicon Generator - http://tools.dynamicdrive.com/favicon
- Data Generator - https://mockaroo.com/
- Mobile Mockup Generator - https://mockuphone.com
- Logo Generator - https://www.logaster.com
- UUID Generator - https://www.uuidgenerator.net/
- Hash Generator - https://passwordsgenerator.net/sha256-hash-generator/
- Ultimate Code Generator - https://webcode.tools/
When starting out with GraphQL and Prisma, the amount of .graphql-files you're working with can be confusing. Yet, it's crucial to understand what the role of each of them is.
Looking only at Prisma, there are two .graphql-files that are relevant:
- The data model containing the model definitions for your service's APIs, typically called
datamodel.graphql. - The Prisma database schema defining the actual CRUD/realtime operations of the service's API, typically called
prisma.graphql.
| """Autogenerated input type of AcceptTopicSuggestion""" | |
| input AcceptTopicSuggestionInput { | |
| """The Node ID of the repository.""" | |
| repositoryId: ID! | |
| """The name of the suggested topic.""" | |
| name: String! | |
| """A unique identifier for the client performing the mutation.""" | |
| clientMutationId: String |
| { | |
| "Console Log": { | |
| "prefix": "cl", | |
| "body": "console.log($1);", | |
| "description": "Console Log" | |
| }, | |
| "Named Function": { | |
| "prefix": "nfn", | |
| "body": ["function ${1:functionName}($2) {", " $3", "}"], | |
| "description": "Named Function" |
| // Construct Single Node | |
| class Node { | |
| constructor(data, next = null) { | |
| this.data = data; | |
| this.next = next; | |
| } | |
| } | |
| // Create/Get/Remove Nodes From Linked List | |
| class LinkedList { |