Giter VIP home page Giter VIP logo

Comments (4)

chuckcarpenter avatar chuckcarpenter commented on May 29, 2024

Is there a workaround recommended or do I just serialize this as a String?

from redwood.

Tobbe avatar Tobbe commented on May 29, 2024

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)
image

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.

Tobbe avatar Tobbe commented on May 29, 2024

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.

Tobbe avatar Tobbe commented on May 29, 2024

Tested with SQLite. Same error/issue
image

from redwood.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.