Skip to content

URIs is null when the field is typed as String or [String] #36

@mielvds

Description

@mielvds

Hello! HyperGraphQL seems to handle URIs as nulls when the field is typed as String or [String]?

A case where you might needs this, is when you have URIs that are only present as object, but never as subject.
Someone's homepage is a concrete example:

ex:Me a schema:Person;
      foaf:homepage <http://me.org> .

In the schema, I could have (although this might also fail):

type __Context {
    Person:                 _@href(iri: "https://schema.org/Person")
    homepage:               _@href(iri: "http://xmlns.com/foaf/0.1/homepage")
}

type Person @service(id:"endpoint") {
    homepage: Homepage @service(id:"endpoint")
}

type Homepage @service(id:"endpoint") {
}

In order to use:

{
  Person {
   homepage {
      _id
    }
  }
}

Or I could have

type Person @service(id:"endpoint") {
    homepage: String @service(id:"endpoint")
}

In order to use:

{
  Person {
    homepage
  }
}

Although option 1 might be more 'correct', I think at least allowing a string representation of the URI is desired behaviour. HypergraphQL seems to return null in case of option 2, which is unexpected and distorts search results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions