Comments (4)
Is there a workaround recommended or do I just serialize this as a String?
from redwood.
I took a look at fixing the test generation logic. And I did get a bit further. But it's still not working. This is where I'm at now:
Screenshot for easier reading (you know, colors and stuff)
Text for easier searching (SEO and stuff)
❯ yarn rw g sdl Key
✔ Generating SDL files...
✔ Successfully wrote file `./api/src/graphql/keys.sdl.ts`
✔ Successfully wrote file `./api/src/services/keys/keys.scenarios.ts`
✔ Successfully wrote file `./api/src/services/keys/keys.test.ts`
✔ Successfully wrote file `./api/src/services/keys/keys.ts`
✔ Generating types ...
Schema loading failed. Unknown type: "Bytes".
Error: Unknown type: "Bytes".
at getNamedType (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/utilities/extendSchema.js:427:13)
at getWrappedType (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/utilities/extendSchema.js:442:12)
at getWrappedType (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/utilities/extendSchema.js:439:45)
at buildInputFieldMap (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/utilities/extendSchema.js:548:22)
at fields (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/utilities/extendSchema.js:757:25)
at resolveObjMapThunk (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/type/definition.js:504:40)
at defineInputFieldMap (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/type/definition.js:1313:20)
at GraphQLInputObjectType.getFields (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/type/definition.js:1276:27)
at collectReferencedTypes (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/type/schema.js:395:51)
at new GraphQLSchema (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/type/schema.js:174:9)
at buildASTSchema (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/graphql/utilities/buildASTSchema.js:93:10)
at makeExecutableSchema (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/schema/cjs/makeExecutableSchema.js:73:47)
at mergeSchemas (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/schema/cjs/merge-schemas.js:32:63)
at getSchemaFromSources (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/load/cjs/schema.js:56:46)
at loadSchema (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/load/cjs/schema.js:19:12)
at async generateGraphQLSchema (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/graphqlSchema.js:68:20)
at async generate (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/generate.js:20:7)
at async _Task.task [as taskFn] (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/cli/dist/commands/generate/sdl/sdl.js:306:13)
at async _Task.run (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/listr2/dist/index.cjs:2049:11)
Error: Could not generate GraphQL type definitions (api)
Error:
Unable to find any GraphQL type definitions for the following pointers:
- /Users/tobbe/tmp/rw-prisma-bytes-sdl/.redwood/schema.graphql
at prepareResult (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/load/cjs/load-typedefs.js:93:15)
at loadTypedefsSync (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/load/cjs/load-typedefs.js:79:20)
at loadSchemaSync (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@graphql-tools/load/cjs/schema.js:28:61)
at getCodegenOptions (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/graphqlCodeGen.js:328:41)
at runCodegenGraphQL (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/graphqlCodeGen.js:163:19)
at async generateTypeDefGraphQLApi (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/graphqlCodeGen.js:87:21)
at async generateTypeDefs (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/typeDefinitions.js:55:7)
at async generate (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/internal/dist/generate/generate.js:24:7)
at async _Task.task [as taskFn] (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/@redwoodjs/cli/dist/commands/generate/sdl/sdl.js:306:13)
at async _Task.run (/Users/tobbe/tmp/rw-prisma-bytes-sdl/node_modules/listr2/dist/index.cjs:2049:11)
from redwood.
The original issue description says "Setup a Postgres datasource (needed for Bytes type)", but I think this applies to Sqlite too. The Bytes type is supported across all engines: https://www.prisma.io/docs/orm/reference/prisma-schema-reference#bytes
(Might be worth noting that when the linked issue, #5841, was created back in 2022 Prisma's docs said Bytes was unsupported for sqlite, so maybe that's where this comes from)
I still need to test with sqlite too though, so I'm not 100% sure where RW's support stands yet as regards to Bytes in Sqlite.
from redwood.
Tested with SQLite. Same error/issue
from redwood.
Related Issues (20)
- [OG] Finish OG Image generation with updated middleware implementation HOT 1
- [Auth] Implement dbAuth middleware
- [Auth] createMiddlewareAuth (web side) for dbAuth
- [Auth] Implement POST handlers for login, signup, etc. on dbAuth
- [Bug?]: dbAuth `userAttributes` comment error HOT 7
- [Bug?]: Uploading files through custom functions doesn't work HOT 1
- [Bug?]: Updating from 7.3.0 to 7.4.1 will fail, if there is no npx available HOT 4
- [Bug?]: console prints wrong GraphQL endpoint when apiGraphQLUrl is set in dev enviornment HOT 4
- [Bug?]: client-build-manifest.json needs an import assertion of type "json" when using RSC HOT 6
- [Bug?]: Cannot wrap components in RedwoodApolloProvider in jest tests HOT 7
- [Bug?]: ERROR Function "" was not found. HOT 8
- [Bug?]: HydrateRoot and TypeError: Cannot read properties of undefined ... at Object.prerenderLoader on whichever page first loads HOT 5
- [Bug?]: Seeing 500s due to ERR_STREAM_PREMATURE_CLOSE after upgrade to 7.x HOT 4
- [Bug?]: fastify compress plugin not working as per docs HOT 3
- [Bug?]: nftPack: undefined is not a function HOT 9
- [Bug?]: Authentication Error After Upgrading from Version 6.6.4 to 7.4.3 HOT 6
- [Docs]: useCache!!! HOT 1
- [Bug?]: Setting --verbose when deploying to baremetal "fails" during cleanup step. SshExecutor.js does not check that "args" is defined. HOT 6
- [Bug?]: yarn rw setup auth supabase not working HOT 5
- [Bug?]: Custom Directive Generator Not working.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redwood.