how can I save a dictionary on the GraphCool?
# prisma-whats-new
m
how can I save a dictionary on the GraphCool?
This is what my schema looks like:
Copy code
type Book implements Node {
  createdAt: DateTime!
  id: ID! @isUnique
  updatedAt: DateTime!
  page: Int!
  content: String!
}
and I want to add a new field called
style
that can save something like this:
Copy code
style: { fontSize: 80, textAlign: 'center', fontWeight: 'bold' }
what type would I need to make the style field as?
n
you can use the Json field type
it feels weird to store CSS on the Server though πŸ˜…
@monte9 do you want to style different entries differently?
m
Indeed. the idea is to basically let each data in the book take responsibilty for adding custom styling per page.
n
haha gotcha!
m
@nilan what would the Json field type looks like?
n
style: Json
m
copy that. Will give that a shot.
Another q for you Nilan! Is there a way to import data into my GraphCool db?
so for instance, in my Book model, I want to be able to import a csv file which has all the data in it.. so I don’t have to maunally add it to the db myself one by one.
πŸ‘πŸ» 1
n
there's currently no way to do it other than with a script πŸ™‚ we're already working on an
import
command with the Graphcool CLI: https://github.com/graphcool/graphcool-cli/issues/1 your input here would be appreciated πŸ™‚
πŸ‘ 1