question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphQLSchema serialization using pickle

See original GitHub issue

Is it possible to serialize an instance of GraphQLSchema?

We would like to dump and load an instance of GraphQLSchema to/from a file for performance reasons.

It does not appear to be serializable using pickle by default.

>       res = pickle.dumps(schema)
E       AttributeError: Can't pickle local object 'extend_schema_impl.<locals>.build_object_type.<locals>.<lambda>'

Thanks in advance.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:24 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
Citocommented, Nov 1, 2022

@danvendia Update: I have looked into the second issue, can reproduce it and have an idea how to solve it, even more fundamentally than the last fix. Will continue to work on it this week.

1reaction
Ambro17commented, Nov 4, 2022

Just came by to say you rock @Cito 🎸

Read more comments on GitHub >

github_iconTop Results From Across the Web

serialization · GitHub Topics
A HDF5-based pickle-like library for object serialization ... JSON (de)serialization, GraphQL and JSON schema generation using Python typing.
Read more >
pickle — Python object serialization — Python 3.11.1 ...
It adds support for very large objects, pickling more kinds of objects, and some data format optimizations. It is the default protocol starting...
Read more >
FastAPI and GraphQL - Ray Serve
I'm trying to get Ray Serve to handle a FastAPI endpoint with GraphQL but getting what seems to be some serialization error. From...
Read more >
Python Tutorial: serialization with pickle - 2020 - BogoToBogo
The dump() function in the pickle module takes a serializable Python data structure, serializes it into a binary, Python-specific format using the latest ......
Read more >
apischema v0.17 - I've developed the fastest typed JSON (de ...
apischema v0.17 - I've developed the fastest typed JSON (de)serialization library, and you can also build your GraphQL schema with it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found