Thank you for contributing code to Prisma! Like many projects, we need a contributor license agreement from you before we can merge in your changes.You only need to fill out this agreement once. In brief, by submitting your code to the Prisma project, you are granting us a right to use that code under the terms of this Agreement, including providing it to others. You are also certifying that you wrote it, and that you are allowed to license it to us. You are not giving up your copyright in your work. Contributor License Agreements are important because they define the chain of ownership of a piece of software. Some companies won't allow the use of free software without clear agreements around code ownership. That's why many open source projects collect similar agreements from contributors. Please read this document carefully before signing and keep a copy for your records. (You'll get an email confirmation when you electro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Prisma Node.JS packages publish script | |
# | |
# Build Order | |
# prisma-client-lib | |
# prisma-generate-schema | |
# prisma-db-introspection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { addFragmentToInfo } from 'graphql-binding' | |
async signup(parent, args, ctx, info) { | |
args.email = args.email.toLowerCase(); | |
const password = await bcrypt.hash(args.password, 10); | |
const user = await ctx.db.mutation.createUser( | |
{ | |
data: { | |
...args, | |
password, | |
permissions: { set: ['USER'] }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as http from 'http' | |
import * as https from 'https' | |
import { GraphQLClient } from 'graphql-request' | |
const debug = require('debug')('TestClient') | |
import { GraphQLServer } from 'graphql-yoga' | |
import { server } from '../server' | |
export default class TestClient { | |
app: GraphQLServer | |
server: http.Server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GraphQLServer } from 'graphql-yoga' | |
import { createRemoteSchema, Delegate, collectTypeDefs, RemoteLink, RemoteSubscriptionsLink, giveMeASchemaFactoryNow, fetchSchema } from 'graphql-remote' | |
import * as jwt from 'jsonwebtoken' | |
import { GraphQLSchema } from 'graphql' | |
import { makeRemoteSchema } from '../src/createRemoteSchema/createRemoteSchema' | |
async function run() { | |
const makeLink = () => new HybridLink({ | |
http: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Websockets Test</title> | |
</head> | |
<body> | |
<script> | |
const socket = new WebSocket( | |
'wss://subscriptions.graph.cool/v1/cirs1ufsg02b101619ru0bx5r','graphql-ws' | |
) | |
socket.addEventListener('open', event => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type User @model { | |
id: ID! @isUnique | |
createdAt: DateTime! | |
updatedAt: DateTime! | |
firstName: String! | |
lastName: String! | |
email: String! @isUnique | |
isSuperHost: Boolean! @defaultValue(value: "false") | |
ownedPlaces: [Place!]! @relation (name: "PlaceOwner") | |
location: Location! @relation (name: "UserLocation") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable } from 'rxjs/Observable' | |
import { SubscriptionClient } from 'subscriptions-transport-ws' | |
const ws = new SubscriptionClient("endpointurl") | |
const observable = Observable.create(observer => { | |
const id = this.ws.subscribe(graphQLParams, (err, res) => { | |
if (err) { | |
observer.next(res) | |
observer.unsubscribe() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ExcludeProps(Component: any, filter: string[] = []) { | |
return (props) => { | |
const keys = Object.keys(props).filter(key => !filter.includes(key)) | |
const picked = lodash.pick(props, keys) | |
return <Component {...picked} /> | |
} | |
} |