Skip to content

Instantly share code, notes, and snippets.

Nikolas nikolasburk

Block or report user

Report or block nikolasburk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View setup-prisma-client-demo-ts.md

Get Your Own Prisma Client Explorer

This project uses a hosted database that has writes disabled. Follow these steps to set up your own demo database that lets you perform database writes:

1. Fork the CodeSandbox

To get your own version of this sandbox, click the Fork button in the top-left corner (then wait until the embedded browser in the new Sandbox ):

View response.md

Personal response to this Twitter thread

I've just been taking a hard look at prisma. and to me it seems like crutch, rather than a solution. my guess is that it works for very simple stuff, but it's not usable for anything more or less "serious".

There are many serious developers and larger companies using Prisma in production today, such as adidas, HyreCar (recently IPOed) or Labelbox (just raised 10mio series A). We have no doubt that Prisma can be used for "serious" applications!

The docs are basically marketing material. "under the hood" doc provides no information I was hoping to find at least there. starting from "how queries are optimized"? some tutorial says there's a dataloader, but that's about it.

You're definitely right that our docs are lacking behind at the moment! We are working on the nex

View prisma-client-explorer-csb.md

Get Your Own Prisma Client Explorer

To get your own Prisma client explorer on CodeSandbox that allows for database writes, you need to perform the following steps:

1. Fork the CodeSandbox

2. Open new Terminal tab

View management.graphql
input AddProjectInput {
name: String!
stage: String!
secrets: [String!]
clientMutationId: String
}
type AddProjectPayload {
project: Project
clientMutationId: String
View prisma-info.md

Data model vs Prisma database schema

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.
@nikolasburk
nikolasburk / stitching.graphql
Last active Jun 29, 2018
stitching.graphql
View stitching.graphql
query myMenu {
menu {
burger {
bun
cheese
patty
}
salad {
romaine
tomato
@nikolasburk
nikolasburk / instructions.md
Last active Aug 14, 2019
Use the Contentful GraphQL API inside a GraphQL Playground
View instructions.md

Use the Contentful GraphQL API inside a GraphQL Playground

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.

1. Get the endpoint for your Contentful GraphQL API

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:

View server.js
import { GraphQLServer } from 'graphql-yoga'
const typeDefs = `
type Query {
hello: String!
}
`
const resolvers = {
Query: {
View resolvers.js
const resolvers = {
Query: {
user: (root, args) => db.getUser(argd.id),
users: () => db.getUsers(),
},
Mutation: {
createUser: (root, args) => db.createUser(args.name),
updateUser: (root, args) => db.updateUser(args.id, args.name),
deleteUser: (root, args) => db.deleteUser(args.id),
}
View resolvers.js
const resolvers = {
Query: {
user: (root, args) => db.getUser(argd.id),
users: () => db.getUsers(),
},
Mutation: {
createUser: (root, args) => db.createUser(args.name),
updateUser: (root, args) => db.updateUser(args.id, args.name),
deleteUser: (root, args) => db.deleteUser(args.id),
},
You can’t perform that action at this time.