I have been using `t.list.json` with the nexus fra...
# graphql-nexus
s
I have been using
t.list.json
with the nexus framework but it doesn't seem to exist now I have switch to
@nexus/schema
. Does anybody know what an alternative of this would be?
Currently use it as
Copy code
t.list.json("images", (supplier: any) => user.userImages.images);
where data is
Copy code
user: {
  userImages: {
    images: [ {id: 1234}, { id: 2345 } ]
  }
}
s
You have to register a new type
If you want typing you can use the third parameter of the method or use the backing type map
s
Nice, thanks, that seemed to work. No real idea what I did with it, but it seems adding this worked...
Copy code
export const json = scalarType({
  name: "json",
  asNexusMethod: "json",
  description: "json",
});
s
yeah its similar to the asNexusMethod function
you still need to specify ther backing type if you want something else than any
👍 1