Moralis GraphQL Console

Hi Moralis community! I have been seeing this error in the GraphQL console: ā€œServer cannot be reachedā€ but my server definitely works because I can log in / log out and run cloud functions.

Any idea what might be going on? I have included my code from the console below and its output.

The input of my GraphQL is this:

type Contract {
  id: ID!
  date: String!
  owner: Owner!
  skills: [skills]
}

type skill {
  id: ID!
  name: Name!
  verification: Boolean!
}

# Write your query or mutation here

The output of my GraphQL shows this:

{
  "error": "Unexpected token < in JSON at position 0"
}

I didn’t use GraphQL before.
What are you trying to do?

I"ve used graphql data schemas a bunch for defining permissions/actions. It’s basically REST but on steroids. So you can create custom queries and mutations but only to certain layers of the data and just overall GraphQL helps you provision one-to-many or many-to-many relationships of data.

For example, let’s say we’re making a todo list, you could do something like this:

type Todo @model @auth(rules: [{ allow: owner }]) {
  id: ID!
  name: String!
  description: String
}

I’d like to be able to provision certain items to be publicly/privately available for certain users, as well as allow users to make updates to or write to the objects created in the database.

what is required to use GraphQL, it is required to have something installed on server side, or you added all the required code in cloud functions?

It would be the method rules for how objects would get stored in the Moralis DB if I’m not mistaken. Like for example, in AWS, you define GraphQL data schema file and that determines what info can go into the database (i.e. DynamoDB).

I believe this is the same w/ Moralis, so you define the graphql schema and in the front-end, you will have user inputs that bind to those Scalar Types (what’s defined in the graphql) that then would fit the rows/columns as Moralis objects in the table.

This should all happen serverlessly I believe, or at least, that’s what is the case w/ AWS, although, the GraphQL files are local within the repo rather than living in the cloud.

My impression for now is that the server has to know how to recognise GraphQL queries in order to process them.

found this in google: https://pretagteam.com/question/how-to-build-a-web-app-with-graphql-parsecom-closed, Moralis server uses Parse

Thanks, @cryptokid! So, as of right now, it’s not a bad thing that it says ā€œServer cannot be reachedā€ — which is probably because I haven’t set up any queries for it yet?

Hm… I didn’t use this future before, but as it is in the interface, it should be possible to use it somehow.
I get same error with ā€œServer cannot be reachedā€ when I open that tab first time.

Maybe it has to do with the fact that there aren’t any objects to work off of? I am just not sure and I don’t think I know anyone who has used this functionality before lol

Same error here, please let me know if you manage to get it to work

Sure sure! Will try and see if I can get there. @Yomoo or @ivan would either of you know about how to get the GraphQL Console to connect to the server? For me, it’s still showing up as this: