import requests


def get_resolution(pdb_id):
    """
    Get the resolution for a PDB id, or None case it doesn't have.
    """
    ret = requests.post(
        "https://data.rcsb.org/graphql",
        json={
            "query": f"""
    {{
        entry(entry_id: "{pdb_id}") {{
            pdbx_vrpt_summary {{
                PDB_resolution
            }}
      }}
    }}
    """
        },
    )
    data = ret.json()
    resol = data["data"]["entry"]["pdbx_vrpt_summary"]["PDB_resolution"]
    return resol