This sketch is outdated. Please refer to https://github.com/prisma/nexus-prisma for current spec & status.
Here is a GraphQL object manually projecting fields from the model layer. Assume the parent returned data of a project model.
objectType({| #!/bin/bash | |
| # Dependency: requires macOCR | |
| # Download: https://github.com/schappim/macOCR | |
| # @raycast.schemaVersion 1 | |
| # @raycast.title macOCR | |
| # @raycast.mode silent | |
| # @raycast.author Lim Chee Aun | |
| # @raycast.authorURL https://github.com/cheeaun |
Here is a GraphQL object manually projecting fields from the model layer. Assume the parent returned data of a project model.
objectType({| function logger(strings,...values) { | |
| var str = ""; | |
| for (let i = 0; i < strings.length; i++) { | |
| if (i > 0) { | |
| if (values[i-1] && typeof values[i-1] == "object") { | |
| if (values[i-1] instanceof Error) { | |
| if (values[i-1].stack) { | |
| str += values[i-1].stack; | |
| continue; | |
| } |
| const randomInterval = (() => { | |
| const random = (min, max) => Math.random() * (max - min) + min; | |
| return (callback, min, max) => { | |
| const time = { | |
| start: performance.now(), | |
| total: random(min, max) | |
| }; | |
| const tick = now => { | |
| if (time.total <= now - time.start) { | |
| time.start = now; |
| # Varnish 4.0 configuration for Craft | |
| # | |
| # Based on the following: | |
| # - https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl | |
| # - https://gist.github.com/aelvan/eba03969f91c1bd51c40 | |
| vcl 4.0; | |
| import std; | |
| import directors; |
| /* Not perfect but looks good considering slack limitations */ | |
| #2B2F3A,#1F232C,#1F232C,#DFE1E8,#4F5C65,#90A2B2,#A1C088,#C36069 |
| '.text.html.twig': | |
| 'Tag Print': | |
| 'prefix': '}}' | |
| 'body': '{{ $1 }}$0' | |
| 'Tag Block': | |
| 'prefix': '%%' | |
| 'body': '{% $1$2 %}$0{% end$1 %}' | |
| 'Tag Block (Block)': |
| { | |
| "snippets": { | |
| "css": { | |
| "snippets": { | |
| "mza": "margin: 0 auto;" | |
| } | |
| } | |
| } | |
| } |