/admin/schema succeeds but changes do not appear

What I want to do

I’m running Dgraph on k8s GCP and I’m trying to add fields and directives to an existing type. Pushing to /admin/schema returns a success but then introspection does not show the new field or changes.

What am I doing wrong?

What I did

Dgraph metadata

21.03.1

So I determined that my schema actually had an error in it. I had the word type written somewhere with no definition. When calling the updateGQLSchema mutation directly, I was able to view the error messages. So I suppose the problem is that when using curl to post my schema, sometimes the errors don’t seem to show up.

Is that fixed?

Um. Sort of? More that I found a workaround.

Using the updateGQLSchema mutation allows me to see error messages in the case my schema has errors.

Using curl to update the schema sometimes doesn’t show me the error in my schema and looks identical to a success. So I thought my schema was being successfully updated but it wasn’t.

Can you explain the two ways you tried? Step by step.

I think it should return error via cURL in fact.

You can see it in the video I posted.

First method (in the video):
curl -X POST localhost:8080/admin/schema --data-binary '@./dgraph/schema.graphql'

It is worth noting that I HAVE received errors using this method in the past, but there have been times when I have also not received errors (as shown in the video)

Second method:
Wrote a script to load my schema file, start an apollo client, and run the updateGQLSchema mutation at /admin

I see, so the second method there is a schema validation? (I don’t use GraphQL everyday)

Yeah, the same (invalid) schema did return with errors with the second method. I have since fixed the errors in my schema file and successfully updated my schema.

Humm, so maybe the first method doesn’t return an error due to something related to the cURL payload way of sending the request. We should check this and document it.