Cors policy issue when importing graphsql schema

On import of graphql schema, origin throws a CORS policy error. Is there something I’m missing or is this a bug?

are you still seeing this error?

1 Like

Dear @eduardo-bruno, the cors policy issue has been fixed! Instead I get an error on my .graphql schema file on importing. However, this is a fresh export made with graphqurl.

Schema file:

What are expecting from? Can you confirm that what you linked to is the exact text you are trying to import into fauna? If not, then that is really what needs to be shared.

Some thing that stand out in shared schema:

  • schema should not be called out. That is, don’t use mutation_root type, just define type Mutation
  • fauna graphql endpoint will not accept customer scalars, e.g. float8
  • importing as is all you the ..._response types will generate a new Collection. Consider @embedded directive with those.
  • All of the mutations will need custom UDFs associated with @resolver

@ptpaterson Yes this is the actual text I’m trying to import into fauna. The schema is created in hasura with underlying postgresql database. I was hoping that extracting it with graphqurl would make it ready to be imported in fauna for easy migration.

Thanks for investigating the file. Do you happen to know a good resource/documentation on .graphql format (and perhaps how to migrate to fauna)?

I strongly recommend reading the docs. Browse topics here. Try some stuff out and get a feel for how Fauna’s GraphQL implementation works. Come back and feel welcome to ask more questions about how to do what you want.

Learning FQL is still valuable and important for many common, basic or advanced scenarios. Fauna is releasing some blogs about that.

I also started a topic here about what I think are good practices regarding customer resolvers.

Tips for migrating specifically… Remember that Fauna is not an SQL database. Fauna requires you to be VERY explicit about things like indexes, sorting, filtering, etc. These things are mostly not out of the box for graphql. The forums has many topics regarding possible new features that are being considered.

1 Like

Thanks @ptpaterson for you expansive response, will look into it!