Cannot change field types via schema file / Ratel

Hello. I have the following schema:

type A {
    a
}

type B {
    b
}

type C {
    c
}

And directives:

b: uid .
c: [uid] .

I want to:

  1. have one-to-one edges between the nodes of type B and type A
  2. have one-to-many edges between the nodes of type C and type B.

When I try to add types to fields via schema file inside type definitions in the following way:

type B {
    b: A
}
type C {
    c: [B]
}

I get the following responses in the console:

Type declaration for type **B** includes deprecated information about field type for field **b** which will be ignored.
Type declaration for type **C** includes deprecated information about field type for field **c** which will be ignored.

Moreover, for some reason in ratel b and c are said to have type [C].
When I try to change field types manually in Ratel, it ignores my changes and brings b and c back to type [C].

A and B-typed nodes both have a “uid” field before an upload.
How do I set types correctly in order to get what is described in 1) and 2) ?

Hi, I tested on version 1.1.1

I added a schema like this:

type A {
    a
}
type B {
    b
}
type C {
    c
}
a: string .
b: uid .
c: [uid] .

I can see it in ratel as:
image
Which is what I would expect.
This field below is ignored currently:

Look at this post regarding constrains: Is it possible to impose restrictions on variables in Dgraph? - #3 by martinmr

There’s nothing wrong with your types. We simplified the type declaration so that the fields don’t contain a type anymore. A type is just a collection of fields. However, Ratel still includes the type column for backwards compatibility.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.