Strange behaviour with interfaces (completly lost now)

Hello,

I tested out the new graphql technology in dgraph and I discovered, for me, a weird behaviour!

When I declare this type

type Test {
    Value: IInformation
}

interface IInformation
{
    Tool: ToolTypes
    Version: Int
    Change: Changeset
}

type IntegerInformation implements IInformation {
    Value: Int
}

type StringInformation implements IInformation {
    Value: String
}

And try to upload it to dgraph I get this error

{
    "errors": [
        {
            "message": "resolving updateGQLSchema failed because while parsing GraphQL schema: input:487: expected at least one definition, found } (Locations: [{Line: 3, Column: 4}])",
            "extensions": {
                "code": "Error"
            }
        }
    ]
}

But when I add a scalar property to the Test type it succeeds.

Can someone explain me this behaviour?

Thanks have a nice day stay safe!
FM

Hi @Florian, what version of Dgraph you are using ?? I also see some types like Changeset and ToolTypes which are not defined.After removing those fields i am able to post schema on master branch.

Hi @JatinDevDG, thanks for that fast answer!

I forget to delete this properties, I am sry for that.
As far as I can tell I am using v20.07.2, seen that in my ratel.
It’s running on windows without docker, if that can help you!

I try to delete them, and try it out.
Give me second =)

No, in my configuration it doesn’t change anything =/

ohhh, strange. For me it’s working in 20.07.2 also. How you are posting schema , means what command you are using?

= / I am master in mysterios things = P

I am posting it via PostMan!

localhost:8080/admin/schema

to this address!
The schema is in the body as binary.
I saved the schema as a .graphql file and send it over via POST

I have no headers.

I watched into logs which dgraph alpha writes

I1216 09:22:03.717095 29368 schema.go:45] Got updateGQLSchema request

Thats the only line he writes out =/

I am getting this error when I select GraphQL in the body. It’s working in binary and raw format.
You can post schema using the below curl request also . Try it and let me know if you face this issue using it also.
curl -X POST localhost:8080/admin/schema --data-binary '@subs.graphql'

Postman already did that already!
When I generator from the request the curl command it looks like this =>

curl -X POST
http://localhost:8080/admin/schema%20--data-binary%20’@subs.graphql’
-H ‘Postman-Token: b446f7f5-f324-4c4a-b8b3-40582c6195cd’
-H ‘cache-control: no-cache’

So, you are not able to upload schema by any of the method?

Yes!

Strange!!! , Here is the screenshot of my Postman tab with the schema. The body is set to raw. Please check if you are missing something.i am trying it on 20.07.3.Can you confirm it on other dgraph versions??

Can it be that its only the postman version?

You use a defently newer one!

I am sorry for late answer = /

Greetings

What I have also seen that you use headers
Can you show me them?

I have no headers defined

i use postman version 7.36.0 .
There are some default headers which are already defined.

you can try with other clients like insomnia or graphql playground.
And even better if you type this in your terminal
curl -X POST localhost:8080/admin/schema --data-binary '@subs.graphql'