#graph-ql #mapi #gqlmapi


Rust bindings for https://github.com/microsoft/gqlmapi

14 breaking releases

0.15.0 Sep 10, 2023
0.13.0 Sep 1, 2023
0.11.0 May 26, 2022
0.8.0 Jan 11, 2022
0.6.0 Sep 3, 2021

#42 in Windows APIs

Download history 4/week @ 2023-06-03 20/week @ 2023-06-17 16/week @ 2023-06-24 16/week @ 2023-07-01 2/week @ 2023-07-08 3/week @ 2023-07-15 6/week @ 2023-07-22 3/week @ 2023-07-29 4/week @ 2023-08-05 16/week @ 2023-08-12 3/week @ 2023-08-19 55/week @ 2023-08-26 43/week @ 2023-09-02 44/week @ 2023-09-09 8/week @ 2023-09-16

151 downloads per month

MIT license

10K SLoC

C++ 8K SLoC // 0.0% comments Rust 1K SLoC GraphQL 471 SLoC


The C++ portion of this crate is based on Electron-GqlMAPI. Unlike that project, there is no V8 engine or Node interoperability/threading requirement. I wrote just enough support code and state management for that API projection though, that I decided to use it as the basis for an API projection to Rust.

The next layer in the Electron stack is eMAPI. The corresponding next layer in this stack is a Tauri app called Tauri GqlMAPI that does the same thing but in a much more lightweight fashion than Electron.

Getting Started

This project only builds on Windows, and I've only tested it with x64 builds. It requires that you have CMake and vcpkg installed, the versions included with Visual Studio 2022 work fine.

You will need to set an environment variable to tell build.rs where to find it, or install the user-wide vcpkg integration before building this crate. In this example, I have vcpkg in a subdirectory called source\repos\microsoft\vcpkg under my user profile, and I'm targetting x64-windows-static, so I don't need to copy any DLLs from vcpkg:

> set VCPKG_ROOT=%USERPROFILE%\source\repos\microsoft\vcpkg


> vcpkg integrate install

The build.rs script determines the target x64-windows or x86-windows platform based on the Rust target, and if you enable the crt-static target feature feature, it also uses the -static triplet. Hint: If you would rather not redistribute DLLs for gqlmapi and cppgraphqlgen with your app, try adding this to the .cargo/config.toml file in your project:

rustflags = ["-C", "target-feature=+crt-static"]

Make sure you have also cloned the gqlmapi sub-module. If you did not clone this repo recursively, you can still pull down the sub-module with a couple of git commands:

> git submodule init
> git submodule update

After that, you should be ready to build with cargo build.


  • Microsoft Outlook for runtime MAPI support
  • gqlmapi for the C++ GraphQL bindings to MAPI
  • vcpkg package manager for the GqlMAPI C++ dependencies
  • cmake crate to automatically build gqlmapi
  • cxx crate to generate the C++ bindings


~3M SLoC