JSON fields prefixed with folio: and what they mean

You may encounter, in some JSON schemas in github, fields that are prefixed with "folio:". For example, in mod-inventory-storage, in the item schema (github link), you see a schema attribute labeled "materialType" like this:

    "materialType": {
      "description": "Item's material type",
      "type": "object",
      "folio:$ref": "materialtype.json",
      "javaType": "org.folio.rest.jaxrs.model.materialTypeVirtual",
      "readonly": true,
      "folio:isVirtual": true,
      "folio:linkBase": "material-types",
      "folio:linkFromField": "materialTypeId",
      "folio:linkToField": "id",
      "folio:includedElement": "mtypes.0"
    },

These fields are there to support GraphQL with FOLIO (https://graphql.org/), which is a different way of searching data with APIs. In particular, the FOLIO Z39.50 server uses GraphQL.

The important takeaway when you see this in the schema is that that materialType field is a virtual link meant to facilitate searching, and doesn't actually contain data. That mean that, for example, you can't send a SQL query to search for a materialType name in the item record, because that part of the schema doesn't actually contain the full materialType record.

More information about GraphQL can be found in the FOLIO module readme: https://github.com/folio-org/mod-graphql

The individual folio: prefixed keyword extensions are explained in the mod-graphql autogen readme: https://github.com/folio-org/mod-graphql/tree/master/src/autogen#option-1-json-schema-extensions

Example GraphQL queries can be found at https://github.com/folio-org/mod-graphql/blob/master/doc/example-queries.md - note that you must have a FOLIO server running GraphQL to experiment with this, it is not simple enough to do with Postman or another API tool.