-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: cover 1-to-n reverse access (#39)
- Loading branch information
1 parent
7a26a49
commit d7030ef
Showing
8 changed files
with
176 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
tests/integration/enum.test.ts → tests/unit/graphqlSchema/enum.test.ts
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import endent from 'endent' | ||
import { objectType } from 'nexus' | ||
import NexusPrismaScalars from '../../../scalars' | ||
import { testGraphqlSchema } from '../../__helpers__' | ||
|
||
testGraphqlSchema({ | ||
description: 'When a JSON field is defined in the Prisma schema it can be projected into the GraphQL API', | ||
datasourceSchema: endent` | ||
model Foo { | ||
id String @id | ||
json Json | ||
} | ||
`, | ||
apiSchema({ Foo }) { | ||
return [ | ||
NexusPrismaScalars.DateTime, | ||
NexusPrismaScalars.Json, | ||
objectType({ | ||
name: Foo.$name, | ||
definition(t) { | ||
t.field(Foo.json.$name, Foo.json) | ||
}, | ||
}), | ||
] | ||
}, | ||
}) |