user, err := client.User.FindOne().Exec(ctx)
email, ok := user.Email()
if !ok {
return fmt.Errorf("email is null")
}
log.Printf("User email is set")
localhost/user
localhost/user?name[equals]=stuff
localhost/user?name[contains]=stuff
func (r UserResolver) User(ctx context.Context, input UserFilterInput) (User, error) {
query := User.Query()
localhost/user
localhost/user?name[equals]=stuff
localhost/user?name[contains]=stuff
func (r UserResolver) User(ctx context.Context, input UserFilterInput) (User, error) {
query := User.Query()
No
- a:
code(hi)
Ok:stuff
- b:
code(hi)
Ok:
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/sh | |
# This script checks if the prisma e2e test workflow passes | |
# Check the end of the file for usage | |
check() { | |
str=$(curl -s "https://github.com/$1/workflows/$2/badge.svg") | |
case "$str" in | |
*"passing"*) |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
) | |
func main() { | |
// Since FindMany only reads data, there can be no expected errors. There may |
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 | |
set -eu | |
a=$1 | |
b=$2 | |
mv "$a" "$a.backup" | |
mv "$b" "$b.backup" |
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 | |
set -eu | |
new=$1 | |
for file in $(ls | sort -g -r) | |
do | |
filename=$(basename "$file") | |
number=$(echo $filename | cut -d- -f1) |
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 | |
set -e | |
swap() { | |
set -eu | |
a=$1 | |
b=$2 |
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
## example | |
```js | |
const user = await prisma.user.update({ | |
where: { | |
email: 'alice@prisma.io', | |
}, | |
data: { | |
posts: { |